Guruprasadh2509 / Ground-Truth-Binary-Masking-

8 stars 3 forks source link

no of classes #1

Closed Vaishali-Nimilan closed 4 years ago

Vaishali-Nimilan commented 4 years ago

I have a JSON file with 4 classes. I have mentioned the number of classes to be 4. I use the same annotation tool as yours self.add_class("D00","D10","D20","D40") TypeError: add_class() takes 4 positional arguments but 5 were given

Also I get the error,

polygons = [r['shape_attributes'] for r in a['regions'].values()] AttributeError: 'list' object has no attribute 'values' Thanks in advance

Guruprasadh2509 commented 4 years ago

I actually worked on 2 classes(binary classification). In case if it is possible, could you please share me sample images may be 2, corresponding JSON file(annotated) and corresponding labels as well, I can check it.

Guruprasadh2509 commented 4 years ago

I am not able to view the annotated image, when I import the json.
Can you try to download the annotated region data by, clicking [Annotation > Save as CSV] in the top menu bar. This will download a text file containing region shape and attribute data. Kindly do it for only the sample image which you have provided. Also kindly change the extenson to PNG from JPEG

Guruprasadh2509 commented 4 years ago

Thank you for sharing me this file, but it is not getting worked out for me. Could you please share me the objective of annotation and on what basis the annotation is made? So that I can try from my end and check. Thank you!

Vaishali-Nimilan commented 4 years ago

Thanks but I think the JSON file itself is corrupted, But thanks for trying. Could you please say some suggestions when I use more than one class, what modifications I might need to do. I could try that when I make a new JSON file.

Guruprasadh2509 commented 4 years ago

When you ran the IPYNB file, did you get some thing like below? Image Count: 2 #total image count Class Count: 2#total class count in 3rd cell of jupyter notebook

  1. BG
  2. Annotated label

I am trying to simulate your issue, will update you once it is completed.

Vaishali-Nimilan commented 4 years ago

Hey, I had the above-mentioned errors, I didn't get the image count or the total number classes when I ran the code. Thank you so much for trying! This code is a really useful one If I am able to create a new JSON file and run the code for more than one class, I will get back to you.

Guruprasadh2509 commented 4 years ago

Its my pleasure :). I referred below two links for making binary mask to work. In MRCNN library, we have visualize module, which I customized in order to save the binary mask images to local directory. I am checking the place where the needed changes need to be placed. I will keep you updated. Thank you! https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/visualize.py https://github.com/matterport/Mask_RCNN/blob/master/samples/balloon/balloon.py

Cipherpy commented 4 years ago

how to modify the code for more number of classes?

Guruprasadh2509 commented 4 years ago

@Cipherpy , I am studying the code, for making the needed changes, I came across below link, where they have used multiple classes, I am also checking the same. https://github.com/SUYEgit/Surgery-Robot-Detection-Segmentation "https://github.com/SUYEgit/Surgery-Robot-Detection-Segmentation/blob/master/surgery.py" has the needed changes

Guruprasadh2509 commented 4 years ago

image I am closing this issue, as the link(https://github.com/SUYEgit/Surgery-Robot-Detection-Segmentation/blob/master/surgery.py) has solution, Kindly refer the same.

Vaishali-Nimilan commented 4 years ago

Thank for the link and for the effort. I will look into it. :)

Cipherpy commented 4 years ago

image I am closing this issue, as the link(https://github.com/SUYEgit/Surgery-Robot-Detection-Segmentation/blob/master/surgery.py) has solution, Kindly refer the same.

Thank you for your effort