From c3acdfd12fb979482a6588469d3f15427f50a12f Mon Sep 17 00:00:00 2001
From: Kai Chen <chenkaidev@gmail.com>
Date: Sun, 25 Aug 2019 23:38:38 +0800
Subject: [PATCH] fix test api (#1255)

---
 mmdet/apis/inference.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mmdet/apis/inference.py b/mmdet/apis/inference.py
index 67b2b24..ccf228a 100644
--- a/mmdet/apis/inference.py
+++ b/mmdet/apis/inference.py
@@ -49,8 +49,13 @@ def init_detector(config, checkpoint=None, device='cuda:0'):
 class LoadImage(object):
 
     def __call__(self, results):
+        if isinstance(results['img'], str):
+            results['filename'] = results['img']
+        else:
+            results['filename'] = None
         img = mmcv.imread(results['img'])
         results['img'] = img
+        results['img_shape'] = img.shape
         results['ori_shape'] = img.shape
         return results
 
-- 
GitLab