Git Product home page Git Product logo

cocoapi's Introduction

YouTubeVIS data loading and evaluation

Introduction

This package provides data loading and evaluation functionalities for video instance segmentation on YouTubeVIS. It is built based on COCO API designed for the MSCOCO dataset (http://cocodataset.org/). For evaluation metrics, please refer to the descriptions for details. We have only implemented Python API for YouTubeVIS. API in other languages are not available for now.

Installation

To install:

cd PythonAPI
# To compile and install locally 
python setup.py build_ext --inplace
# To install library to Python site-packages 
python setup.py build_ext install

Contact

If you have any questions regarding the repo, please create an issue.

cocoapi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cocoapi's Issues

How to encode masks to the YouTubeVIS CodaLab format?

Hey,

Thank you for this work (and MaskTrackRCNN). I have generated masks as (height, width) PyTorch-BoolTensors and would like to evaluate them using the CodaLab evaluation page. Each segmentation seems to have the structure {'size': (height, width), 'counts': rle} where rle is an encoding of the mask. How do I convert my masks? I have tried:

import third_party.cocoapi.PythonAPI.pycocotools.mask as cocomask

# mask is (height, width) torch.BoolTensor
mask = np.array(mask.cpu().numpy()[:, :, np.newaxis], order='F')
rle = cocomask.encode(mask)[0]
rle['counts'] = rle['counts'].decode()
return rle

Best regards,
Joakim

I can`t load version2019 dataset with PythonAPI

Hi, thanks to your work, but I encountered some problems.
I download version2019 video instance segmentation dataset from this link:https://competitions.codalab.org/competitions/20128#participate-get_data.
But the labels of json style are inconsistent with the format given on this web page.
For example, I open the valid.json with vscode and search ' "segmenation" ' keyword while there are no any results.
Then I tried to load data with PythonAPI, I modified the path parameter and run pycocoDemo.ipynb to load valid.json which was downloaded from https://drive.google.com/drive/folders/1VBeVXSf-HfrhyBurtu1xfGn6zQ-ALpjZ?usp=sharing, but I got this error:

print(len(coco.dataset['categories']))
print(coco.dataset['categories'][0]['id'])
print(len(coco.imgs))
catIds = coco.getCatIds(catNms=['person','dog','skateboard']);
print(type(catIds[0]))
imgIds = coco.getImgIds(catIds=catIds );
print(imgIds)
imgIds = coco.getImgIds(imgIds = [324158])
img = coco.loadImgs(imgIds[np.random.randint(0,len(imgIds))])[0]

40
1
0
<class 'int'>
[]
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-25-021d63060e40> in <module>
      8 print(imgIds)
      9 imgIds = coco.getImgIds(imgIds = [324158])
---> 10 img = coco.loadImgs(imgIds[np.random.randint(0,len(imgIds))])[0]

/data/EventSegmentation/MaskTrackRCNN/cocoapi/PythonAPI/pycocotools/coco.py in loadImgs(self, ids)
    229             return [self.imgs[id] for id in ids]
    230         elif type(ids) == int:
--> 231             return [self.imgs[ids]]
    232 
    233     def showAnns(self, anns):

KeyError: 324158

Is there anything wrong with my operation? or the format is really different with the style on that web page?

Problem on upload to server

Hi,

Thank you for your work! I was trying to submit my results to the CodaLab server but came across the following error. Could you guide me as to why this may be occurring?

Traceback (most recent call last):
  File "/worker/worker.py", line 330, in run
    if input_rel_path not in bundles:
TypeError: argument of type 'NoneType' is not iterable

As a sanity check, I also tried uploading the valid_submission_sample.zip to the server for evaluation, but I got the same error in that case as well. Is something wrong with the server evaluation?

Name 'unicode' is not defined

Hi,

I was using loadRes in ytvos.py at Line 216, and I came across the following error:
NameError: name 'unicode' is not defined

I believe it has something to with Python3 replacing unicode with str.

Is pycocotools not built for Python3? Could this be changed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.