jsbroks / coco-annotator

:pencil2: Web-based image segmentation tool for object detection, localization, and keypoints
MIT License
2.11k stars 462 forks source link

Error on segmentation save #93

Closed bencevans closed 5 years ago

bencevans commented 5 years ago
flask_1     | [2019-01-31 00:01:16 +0000] [14] [DEBUG] POST /api/annotator/data
flask_1     | [2019-01-31 00:01:16,612] ERROR in app: Exception on /api/annotator/data [POST]
flask_1     | Traceback (most recent call last):
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
flask_1     |     rv = self.dispatch_request()
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
flask_1     |     return self.view_functions[rule.endpoint](**req.view_args)
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask_restplus/api.py", line 325, in wrapper
flask_1     |     resp = resource(*args, **kwargs)
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 88, in view
flask_1     |     return self.dispatch_request(*args, **kwargs)
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
flask_1     |     resp = meth(*args, **kwargs)
flask_1     |   File "/usr/local/lib/python3.6/site-packages/flask_login/utils.py", line 261, in decorated_view
flask_1     |     return func(*args, **kwargs)
flask_1     |   File "/workspace/app/api/annotator.py", line 80, in post
flask_1     |     paperjs_to_coco(width, height, paperjs_object)
flask_1     |   File "/workspace/app/util/coco_util.py", line 64, in paperjs_to_coco
flask_1     |     rles = mask.frPyObjects(segments, image_height, image_width)
flask_1     |   File "pycocotools/_mask.pyx", line 293, in pycocotools._mask.frPyObjects
flask_1     | TypeError: Argument 'bb' has incorrect type (expected numpy.ndarray, got list)

I can't seem to pinpoint particular method of replication however each time I go through a couple of images (using the next image button) and drawing a few segmentation. It's not apparent the data hasn't saved from the user interface however returning to the image... the entities are saved but not the paths.

matt-deboer commented 5 years ago

I fixed this in #78; see the diff here: https://github.com/jsbroks/coco-annotator/pull/78/files#diff-66de3b80e532c3ec4b649584256188d2R7-R73, in app/util/coco_util.py.

I can supply a quick PR for that...