dbolya / yolact

A simple, fully convolutional model for real-time instance segmentation.
MIT License
5.02k stars 1.32k forks source link

Evaluate Only Image(s) #253

Open mdtjan opened 4 years ago

mdtjan commented 4 years ago

Thank you for your contribution!

By the way I have question, how do I inference an image and dump the bbox & mask information to file? I don't have any json file whatsoever related to those images, image only.

Thanks!

abhigoku10 commented 4 years ago

244 Please see this reference it will help @mdtjan

mdtjan commented 4 years ago

Great! Thanks for your help. @dbolya

By the way, I'm trying to follow #244 and #230

So here's what I tried:

  1. error (1) when set has_gt in config.py into False, so it must be True(?)
  2. create notation for image in COCO format, but with empty List for annotations. Still have error (1).
  3. input [[0,0]], 0, [0,0,0,0] for "segmentation", "area", and "bbox" respectively in annotations. Still error (2).

Error (1) Traceback (most recent call last): File "eval.py", line 1079, in evaluate(net, dataset) File "eval.py", line 909, in evaluate img, gt, gt_masks, h, w, num_crowd = dataset.pull_item(image_idx) File "/home/martin/yolact/data/coco.py", line 173, in pull_item if target.shape[0] == 0: AttributeError: 'NoneType' object has no attribute 'shape'

Error (2) Traceback (most recent call last): File "eval.py", line 1079, in evaluate(net, dataset) File "eval.py", line 909, in evaluate img, gt, gt_masks, h, w, num_crowd = dataset.pull_item(image_idx) File "/home/martin/yolact/data/coco.py", line 149, in pull_item masks = [self.coco.annToMask(obj).reshape(-1) for obj in target] File "/home/martin/yolact/data/coco.py", line 149, in masks = [self.coco.annToMask(obj).reshape(-1) for obj in target] File "/home/martin/anaconda3/envs/research/lib/python3.6/site-packages/pycocotools/coco.py", line 431, in annToMask rle = self.annToRLE(ann) File "/home/martin/anaconda3/envs/research/lib/python3.6/site-packages/pycocotools/coco.py", line 416, in annToRLE rles = maskUtils.frPyObjects(segm, h, w) File "pycocotools/_mask.pyx", line 307, in pycocotools._mask.frPyObjects Exception: input type is not supported.

Do you have any idea how to solve it?

mdtjan commented 4 years ago

I also tried to follow coco2017_testdev_dataset definition and all in #230

All I got is Error (1). I'm positive about that.