Skip to content

Commit f38374f

Browse files
authored
Update coco.py
1 parent aed58a2 commit f38374f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/dataset/coco.py

+4
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,14 @@ def _load_coco_person_detection_results(self):
271271
# changed by Junwei for inferencing on actev videos
272272
img_name = os.path.join(self.frame_path, self.videoname, "%s_F_%08d.jpg" % (self.videoname, det_res['image_id']))
273273
if self.check_img:
274+
if not os.path.exists(img_name):
275+
logger.info("ignoring %s" % img_name)
276+
continue
274277
try:
275278
data_test = cv2.imread(img_name, cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION)
276279
data_test = cv2.cvtColor(data_test, cv2.COLOR_BGR2RGB)
277280
except Exception as e:
281+
logger.info("ignoring %s" % img_name)
278282
continue
279283

280284
box = det_res['bbox']

0 commit comments

Comments
 (0)