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

bump pycocotools and lvis version #5

Merged
merged 9 commits into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ jobs:
- name: Lint with flake8
run: flake8 --max-complexity 20 .
- name: Lint with isort
run: isort -rc --check-only --diff PythonAPI/
run: isort -rc --check-only --diff pycocotools/ lvis/
- name: Format with yapf
run: yapf -r -d PythonAPI
run: yapf -r -d pycocotools/ lvis/
- name: Install python dependencies
run: pip install numpy
- name: Build and install
run: cd PythonAPI && rm -rf .eggs && pip install -e .
- name: Build and install pycocotools
run: cd pycocotools && rm -rf *.eggs-info && pip install -e .
- name: Build and install lvis
run: cd lvis && rm -rf *.eggs-info && pip install -e .
16 changes: 6 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,9 @@ external/
.idea
.DS_Store

MatlabAPI/analyze*/
MatlabAPI/visualize*/
MatlabAPI/private/maskApiMex.*

PythonAPI/pycocotools/__init__.pyc
PythonAPI/pycocotools/_mask.c
PythonAPI/pycocotools/_mask.so
PythonAPI/pycocotools/coco.pyc
PythonAPI/pycocotools/cocoeval.pyc
PythonAPI/pycocotools/mask.pyc
pycocotools/pycocotools/__init__.pyc
pycocotools/pycocotools/_mask.c
pycocotools/pycocotools/_mask.so
pycocotools/pycocotools/coco.pyc
pycocotools/pycocotools/cocoeval.pyc
pycocotools/pycocotools/mask.pyc
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
known_third_party = matplotlib,numpy,pycocotools,setuptools
known_third_party = cv2,matplotlib,numpy,setuptools
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Open-MMLab cocoapi
In this repo, we merged COCO and LVIS API into one repo.

For better compatability with Open-MMLab projects, we fork from original
repo and remove some legacy code.
Also we unify the api of COCO and LVIS, since they share similar functions.

Notes:
* We add snack case aliases for functions of [COCO](pycocotools/coco.py).
* The the package version requirement of `lvis-api` is lifted.
* The major version of `cocoapi` and `lvis-api` in this repo is offseted by 10.
Namely, `[email protected]>[email protected]`, `[email protected]>[email protected]`.

# Installation
Currently, you could install by run
```
# Install cocoapi
pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"
# Install lvis-api
pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=lvis"
```

# Reference
* [cocoapi](https://github.com/cocodataset/cocoapi) of [COCO dataset](http://cocodataset.org/).
* [lvis-api](https://github.com/lvis-dataset/lvis-api) of [LVIS dataset](http://lvisdataset.org).
15 changes: 0 additions & 15 deletions README.txt

This file was deleted.

3 changes: 2 additions & 1 deletion PythonAPI/lvis/__init__.py → lvis/lvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .eval import LVISEval
from .lvis import LVIS
from .results import LVISResults
from .vis import LVISVis

__all__ = ['LVIS', 'LVISResults', 'LVISEval']
__all__ = ['LVIS', 'LVISResults', 'LVISEval', 'LVISVis']
249 changes: 249 additions & 0 deletions lvis/lvis/colormap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
"""An awesome colormap for really neat visualizations. Taken from detectron."""

import numpy as np


def colormap(rgb=False):
color_list = np.array([
0.000,
0.447,
0.741,
0.850,
0.325,
0.098,
0.929,
0.694,
0.125,
0.494,
0.184,
0.556,
0.466,
0.674,
0.188,
0.301,
0.745,
0.933,
0.635,
0.078,
0.184,
0.300,
0.300,
0.300,
0.600,
0.600,
0.600,
1.000,
0.000,
0.000,
1.000,
0.500,
0.000,
0.749,
0.749,
0.000,
0.000,
1.000,
0.000,
0.000,
0.000,
1.000,
0.667,
0.000,
1.000,
0.333,
0.333,
0.000,
0.333,
0.667,
0.000,
0.333,
1.000,
0.000,
0.667,
0.333,
0.000,
0.667,
0.667,
0.000,
0.667,
1.000,
0.000,
1.000,
0.333,
0.000,
1.000,
0.667,
0.000,
1.000,
1.000,
0.000,
0.000,
0.333,
0.500,
0.000,
0.667,
0.500,
0.000,
1.000,
0.500,
0.333,
0.000,
0.500,
0.333,
0.333,
0.500,
0.333,
0.667,
0.500,
0.333,
1.000,
0.500,
0.667,
0.000,
0.500,
0.667,
0.333,
0.500,
0.667,
0.667,
0.500,
0.667,
1.000,
0.500,
1.000,
0.000,
0.500,
1.000,
0.333,
0.500,
1.000,
0.667,
0.500,
1.000,
1.000,
0.500,
0.000,
0.333,
1.000,
0.000,
0.667,
1.000,
0.000,
1.000,
1.000,
0.333,
0.000,
1.000,
0.333,
0.333,
1.000,
0.333,
0.667,
1.000,
0.333,
1.000,
1.000,
0.667,
0.000,
1.000,
0.667,
0.333,
1.000,
0.667,
0.667,
1.000,
0.667,
1.000,
1.000,
1.000,
0.000,
1.000,
1.000,
0.333,
1.000,
1.000,
0.667,
1.000,
0.167,
0.000,
0.000,
0.333,
0.000,
0.000,
0.500,
0.000,
0.000,
0.667,
0.000,
0.000,
0.833,
0.000,
0.000,
1.000,
0.000,
0.000,
0.000,
0.167,
0.000,
0.000,
0.333,
0.000,
0.000,
0.500,
0.000,
0.000,
0.667,
0.000,
0.000,
0.833,
0.000,
0.000,
1.000,
0.000,
0.000,
0.000,
0.167,
0.000,
0.000,
0.333,
0.000,
0.000,
0.500,
0.000,
0.000,
0.667,
0.000,
0.000,
0.833,
0.000,
0.000,
1.000,
0.000,
0.000,
0.000,
0.143,
0.143,
0.143,
0.286,
0.286,
0.286,
0.429,
0.429,
0.429,
0.571,
0.571,
0.571,
0.714,
0.714,
0.714,
0.857,
0.857,
0.857,
1.000,
1.000,
1.000,
]).astype(np.float32)
color_list = color_list.reshape((-1, 3)) * 255
if not rgb:
color_list = color_list[:, ::-1]
return color_list
1 change: 1 addition & 0 deletions PythonAPI/lvis/eval.py → lvis/lvis/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from collections import OrderedDict, defaultdict

import numpy as np

import pycocotools.mask as mask_utils

from .lvis import LVIS
Expand Down
File renamed without changes.
File renamed without changes.
Loading