Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi I am confused in using the coco api , especially about segmentation task of mask api. Can anyone give some example about segmentation task relate api please? #83

Open
lianshushu opened this issue Oct 10, 2017 · 15 comments

Comments

@lianshushu
Copy link

No description provided.

@nightrome
Copy link

I assume you are talking about object/thing segmentation. In that case take a look at https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoDemo.ipynb . For stuff segmentation go to https://github.com/nightrome/cocoapi

@lianshushu
Copy link
Author

I had read the demon program but did not get help for my work. I need to get the instance segmentaion label for every image. Do you have any example or document about the kind of operation please. Thank you so much!

@lianshushu
Copy link
Author

when given an image name , I want to get all instances or object label in this image from 0-80 pixel by pixel. The demon code seems to be given an instance class id and get you the image id(name) which made confused.

@nightrome
Copy link

You can always ignore some of the fields:
annIds = coco_kps.getAnnIds(imgIds=img['id'], catIds=catIds, iscrowd=None)
Just don't set catIds. Then run
anns = coco_kps.loadAnns(annIds)
And then convert the annotations to a pixel level mask, similar to https://github.com/nightrome/cocoapi/blob/master/PythonAPI/pycocotools/cocostuffhelper.py#L98

@Shanzaay
Copy link

Shanzaay commented Jun 9, 2019

After a lot of effort and search, I was finally able to install coco API. I am trying to run a video captioning code. A neural network for video captioning. These are the libraries which are not executing because anaconda coco API doesn't work anymore. But I installed it anyway.
from pycocoevalcap.tokenizer.ptbtokenizer import PTBTokenizer
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.meteor.meteor import Meteor
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider

The only line that is executing is this one.
from pycocotools.coco import COCO

How do I run the rest of the above library lines?

Thanks in advance.

@nightrome
Copy link

@Shanzaay I don't think you properly setup the API. The file is at https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/coco.py . Somehow that folder does not seem to be on your PYTHONPATH.

@Shanzaay
Copy link

@nightrome it's my first time with this kinda thing. Call me a newbie. Now I am more confused than before. Can you guide me in this? How do I make those libraries execute and how to properly install coco API.
And yeah you are right now I am having an error even on this line now: from pycocotools.coco import COCO

A step by step guidance will be great.

Thanks a lot.

@nightrome
Copy link

@Shanzaay
The instructions are at: https://github.com/cocodataset/cocoapi
You can verify your PYTHONPATH by doing echo $PYTHONPATH.
If there is no entry there for COCO, then check the various other issues in this forum and see if anyone has similar problems.

@Shanzaay
Copy link

Ok, I'll try it @nightrome. And thanks a bunch.

@Shanzaay
Copy link

@nightrome so here are the steps i performed:
I clone the repo
i commented this line in setup.py:
#extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
other wise it give error

once it installed i get something like this:
Using c:\users\myusername\anaconda3\lib\site-packages
Finished processing dependencies for pycocotools==2.0

But i am still having the error. What is it that i am doing wrong?

@nightrome
Copy link

@Shanzaay Sorry, I haven't tried it on Windows. Please take a look at the various other Windows issues, e.g. #9

@Shanzaay
Copy link

Ok thanks. @nightrome does cocoAPI is not supported by Python 3?

@nightrome
Copy link

Python 3 should not be a problem. But they officially state on the link above that Windows is not supported.

@virafpatrawala
Copy link

Hey, I have recently written an entire post on exploring and manipulating the COCO dataset for Image Segmentation. Do have a look.

@xml94
Copy link

xml94 commented May 25, 2020

Hey, I have recently written an entire post on exploring and manipulating the COCO dataset for Image Segmentation. Do have a look.

I read your post, and my got my answer about how to get mask from the dataset. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants