From 7f4a607cf026adb1d43aa43a137598702da29a2b Mon Sep 17 00:00:00 2001 From: Jerry Jiarui XU Date: Tue, 9 Jun 2020 12:57:47 +0800 Subject: [PATCH] move common under pycocotools (#9) * move common under pycocotools * change build to pip install . * update doc --- .github/workflows/build.yml | 4 ++-- README.md | 21 +++++++++++++-------- pycocotools/MANIFEST.in | 2 ++ {common => pycocotools/common}/gason.cpp | 0 {common => pycocotools/common}/gason.h | 0 {common => pycocotools/common}/maskApi.c | 0 {common => pycocotools/common}/maskApi.h | 0 pycocotools/setup.py | 4 ++-- 8 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 pycocotools/MANIFEST.in rename {common => pycocotools/common}/gason.cpp (100%) rename {common => pycocotools/common}/gason.h (100%) rename {common => pycocotools/common}/maskApi.c (100%) rename {common => pycocotools/common}/maskApi.h (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9441f20..9755a0f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,6 @@ jobs: - name: Install python dependencies run: pip install numpy - name: Build and install pycocotools - run: cd pycocotools && rm -rf *.eggs-info && pip install -e . + run: cd pycocotools && rm -rf *.eggs-info && pip install . - name: Build and install lvis - run: cd lvis && rm -rf *.eggs-info && pip install -e . + run: cd lvis && rm -rf *.eggs-info && pip install . diff --git a/README.md b/README.md index b9f966ea..22fdd100 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ -# Open-MMLab cocoapi +# OpenMMLab 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. +For bug fixes and better compatability with OpenMMLab projects, we fork from original +repo, which receive few updates is likely to cause problems with some latest dependencies like numpy. +We remove some legacy codes and 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 the package version requirement of `lvis-api` is relaxed. * The major version of `cocoapi` and `lvis-api` in this repo is offseted by 10. Namely, `cocoapi@2.0.0->cocoapi@12.0.0`, `lvis-api@0.5.2->lvis-api@10.5.2`. -# Installation +## Installation + Currently, you could install by run -``` + +```shell # 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 +## 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). diff --git a/pycocotools/MANIFEST.in b/pycocotools/MANIFEST.in new file mode 100644 index 00000000..fdf829e3 --- /dev/null +++ b/pycocotools/MANIFEST.in @@ -0,0 +1,2 @@ +include common/*.cpp common/*.h common/*.c +include pycocotools/_mask.pyx diff --git a/common/gason.cpp b/pycocotools/common/gason.cpp similarity index 100% rename from common/gason.cpp rename to pycocotools/common/gason.cpp diff --git a/common/gason.h b/pycocotools/common/gason.h similarity index 100% rename from common/gason.h rename to pycocotools/common/gason.h diff --git a/common/maskApi.c b/pycocotools/common/maskApi.c similarity index 100% rename from common/maskApi.c rename to pycocotools/common/maskApi.c diff --git a/common/maskApi.h b/pycocotools/common/maskApi.h similarity index 100% rename from common/maskApi.h rename to pycocotools/common/maskApi.h diff --git a/pycocotools/setup.py b/pycocotools/setup.py index be07022e..ad1e3808 100644 --- a/pycocotools/setup.py +++ b/pycocotools/setup.py @@ -11,8 +11,8 @@ ext_modules = [ Extension( 'pycocotools._mask', - sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'], - include_dirs=[np.get_include(), '../common'], + sources=['common/maskApi.c', 'pycocotools/_mask.pyx'], + include_dirs=[np.get_include(), 'common'], # extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], extra_compile_args=[], )