jsbroks / coco-annotator

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

Imported Annotations are not refreshed on Dataset view #335

Open dreaquil opened 4 years ago

dreaquil commented 4 years ago

Hi!

First of all, thanks so much for the work you've done on this project.

I created a dataset where I've uploaded my images for which I already have coco annotated data. I subsequently click on the dataset and import the annotations. This works well and only throws 1 warning for a missing annotation (out of several thousand imports).

The only issue is that until you click each image and cycle through the entire dataset, the images will not be marked as annotated at all. This lead to trying to debug the import feature thinking it didn't work correctly. Not sure if this is intended functionality.

EDIT: As a consequence, the export will only generate for those that have been picked up correctly.

EDIT2: I pulled the annotation data for images marked as unannotated and got the following:

{
  "image": {
    "id": 2119,
    "dataset_id": 3,
    "category_ids": [],
    "path": "/datasets/ImproveSet2/0994_079_img042l.jpg",
    "width": 1024,
    "height": 768,
    "file_name": "0994_079_img042l.jpg",
    "annotated": false,
    "annotating": [],
    "num_annotations": 0,
    "metadata": {},
    "deleted": false,
    "milliseconds": 0,
    "events": [],
    "regenerate_thumbnail": false,
    "previous": 1949,
    "next": 2120
  }

Meaning the annotated attribute isn't being set on import.

jsbroks commented 4 years ago

Are on you on the latest or stable build?

dreaquil commented 4 years ago

I believe I'm on the latest production build. I pulled the repo and did

docker-compose up

Edit: I did a docker-compose pull. There were some updates but still have the same issues.

Edit2: I thought there might be some relation to the fact that when the annotations were first imported, the categories needed to be created. However, I have now tested this and it doesn't make a difference. Steps I took: Create a new dataset with all categories required, added images to the newly created folder, pressed scan to detect new images, imported annotations from coco json.

Edit3: Also Scan doesn't help in detecting annotations. I presume that's only intended for discovering new images.

anthonyfong100 commented 4 years ago

Hi, i too faced the same problem with the importing of coco annotations and the image_model annotated being set as false. I think the problem is at backend/webserver/api/annotator.py the num_annotations = 0 (line 70) is defined within the for each category loop, when instead it should be defined outside the category loop.

jsbroks commented 4 years ago

@anthonyfong100 I think you are right

dreaquil commented 4 years ago

@jsbroks I tried to test this on the development environment but don't see a change in behaviour. Just to confirm that I'm doing this correctly:

Right?

dreaquil commented 4 years ago

Just wanted to follow up that the above mentioned fix resolves another bug but not this one. The annotation exporter only recognises images which were clicked through.

satheeshkatipomu commented 4 years ago

@dreaquil , have you solved this issue? Also, I am facing another issue, if I click on the dataset and on an image, it is taking forever to save the image annotations.