gothicai / instaboost Goto Github PK
View Code? Open in Web Editor NEWCode for ICCV2019 paper "InstaBoost: Boosting Instance Segmentation Via Probability Map Guided Copy-Pasting"
Code for ICCV2019 paper "InstaBoost: Boosting Instance Segmentation Via Probability Map Guided Copy-Pasting"
flake8 testing of https://github.com/GothicAi/Instaboost on Python 3.7.1
$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
./yolact/layers/output_utils.py:59:17: F821 undefined name 'center_size'
boxes = center_size(boxes)
^
./yolact/layers/modules/multibox_loss.py:383:26: F821 undefined name 'sanitize_coordinates'
x1, x2 = sanitize_coordinates(pos_bboxes[:, 0], pos_bboxes[:, 2], img_width)
^
./yolact/layers/modules/multibox_loss.py:384:26: F821 undefined name 'sanitize_coordinates'
y1, y2 = sanitize_coordinates(pos_bboxes[:, 1], pos_bboxes[:, 3], img_height)
^
3 F821 undefined name 'sanitize_coordinates'
3
E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
name
name
in __all__
In table 1
Maskrcnn (res50-fpn) is 37.6 which is same as perfomance in https://github.com/roytseng-tw/Detectron.pytorch/blob/master/BENCHMARK.md.
This is COCO val2017 results rather than test-dev results? Are you confused with this two eval sets?
In table 5
The result of maskrcnn (res50-fpn) becomes 38.2 .
I am lost in these. Which codebase do you use in different tables and different rows in a table?
do you have cascade_mask_rcnn_x152_32x8d_fpn ?
thank you
Hi @Fang-Haoshu ! Thanks for your great work on Instaboost!
I would like to train a Mask-RCNN with Instaboost and some other tricks on my own using mmdetection, but I'm considering whether it is necessary to train the model for 4x, which is maybe too costly. May I ask that have you tried training the models for fewer epochs (2x or 3x)? If so, could you please report the results? Thank you!
When I set heatmap_flag=True, I met some warnings like these.
/home/hooks.hl/anaconda3/envs/test2/lib/python3.6/site-packages/instaboost/help_functions.py:122: RuntimeWarning: invalid value encountered in true_divide
heatmap = heatmap/mm *255
/home/hooks.hl/anaconda3/envs/test2/lib/python3.6/site-packages/instaboost/pointByHeatmap.py:124: RuntimeWarning: invalid value encountered in greater
poses = np.stack(np.where(heatmap>200), axis=1)
/home/hooks.hl/anaconda3/envs/test2/lib/python3.6/site-packages/instaboost/pointByHeatmap.py:126: RuntimeWarning: invalid value encountered in greater
poses = np.stack(np.where(heatmap>150), axis=1)
Could you know whether it affects the result?
I am attempting to install Instaboost on a platform with aarch64 (anaconda is unavailable for this architecture, NVIDIA Linux 4 Tegra 32.2.1 running Ubuntu 18.04).
I successfully installed OpenCV 2.4.13 and opencv-mat in a virtual environment, following the provided instructions.
However, it appears the opencv install did not include opencv-python, despite having set BUILD_opencv_python=ON. I don't see a version of opencv-python matching 2.14 available in the release history on pypi. Does the version of opencv-python have to also be 2.14? Is there a different parameter I should be setting in CMakeLists when I install opencv-2.4.13? Would appreciate any help you can provide.
Thank you in advance!
When I add instaboost to the pipeline i see below
string indices must be integers
File "/opt/conda/lib/python3.7/site-packages/instaboostfast/InstaBoost.py", line 33, in get_new_data
extract(ori_anns, ori_img, config)
File "/opt/conda/lib/python3.7/site-packages/instaboostfast/get_instance_group.py", line 134, in extract
mask, labels = __get_coco_masks(anns, height, width)
File "/opt/conda/lib/python3.7/site-packages/instaboostfast/get_instance_group.py", line 54, in __get_coco_masks
m = cocoseg_to_binary(ann['segmentation'], height, width) # zero one mask
File "/opt/conda/lib/python3.7/site-packages/instaboostfast/get_instance_group.py", line 29, in cocoseg_to_binary
rle = cocomask.merge(seg)
File "pycocotools/_mask.pyx", line 153, in pycocotools._mask.merge
File "pycocotools/_mask.pyx", line 128, in pycocotools._mask._frString
TypeError: string indices must be integers
When installing instaboost, the follow error occured.
ERROR: Failed building wheel for opencv-mat
Running setup.py clean for opencv-mat
Failed to build opencv-mat
Installing collected packages: opencv-mat, instaboost
Running setup.py install for opencv-mat ... error
ERROR: Complete output from command /opt/conda/envs/maskrcnn/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-qqkxalw5/opencv-mat/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-p1y930co/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
building 'opencv_mat' extension
creating build
creating build/temp.linux-x86_64-3.7
gcc -pthread -B /opt/conda/envs/maskrcnn/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/opt/conda/envs/maskrcnn/lib/python3.7/site-packages/numpy/core/include -I/usr/include/opencv2 -I/opt/conda/envs/maskrcnn/include/python3.7m -c opencv_mat.cpp -o build/temp.linux-x86_64-3.7/opencv_mat.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /opt/conda/envs/maskrcnn/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:0,
from /opt/conda/envs/maskrcnn/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /opt/conda/envs/maskrcnn/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from opencv_mat.cpp:787:
/opt/conda/envs/maskrcnn/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with "
^
In file included from opencv_mat.cpp:789:0:
/usr/include/opencv2/core/core.hpp:221:0: warning: "CV_Error" redefined
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, CV_Func, FILE, LINE) )
^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/base.hpp:431:0: note: this is the location of the previous definition
#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, FILE, LINE )
^
In file included from opencv_mat.cpp:789:0:
/usr/include/opencv2/core/core.hpp:222:0: warning: "CV_Error_" redefined
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, CV_Func, FILE, LINE) )
^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/base.hpp:445:0: note: this is the location of the previous definition
#define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, FILE, LINE )
^
In file included from opencv_mat.cpp:789:0:
/usr/include/opencv2/core/core.hpp:223:0: warning: "CV_Assert" redefined
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, CV_Func, FILE, LINE) )
^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/base.hpp:453:0: note: this is the location of the previous definition
#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, FILE, LINE ); } while(0)
^
In file included from /usr/include/opencv2/core/core.hpp:49:0,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:97:1: error: ‘IplImage’ does not name a type
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
^
/usr/local/include/opencv2/core/core_c.h:109:1: error: ‘IplImage’ does not name a type
CVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth,
^
/usr/local/include/opencv2/core/core_c.h:125:1: error: ‘IplImage’ does not name a type
CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels );
^
In file included from /usr/local/include/opencv2/core/utility.hpp:1271:0,
from /usr/local/include/opencv2/core.hpp:3280,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:140:36: error: variable or field ‘cvReleaseImageHeader’ declared void
CVAPI(void) cvReleaseImageHeader( IplImage** image );
^
/usr/local/include/opencv2/core/core_c.h:140:36: error: ‘IplImage’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:140:47: error: ‘image’ was not declared in this scope
CVAPI(void) cvReleaseImageHeader( IplImage** image );
^
/usr/local/include/opencv2/core/core_c.h:154:30: error: variable or field ‘cvReleaseImage’ declared void
CVAPI(void) cvReleaseImage( IplImage** image );
^
/usr/local/include/opencv2/core/core_c.h:154:30: error: ‘IplImage’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:154:41: error: ‘image’ was not declared in this scope
CVAPI(void) cvReleaseImage( IplImage** image );
^
In file included from /usr/include/opencv2/core/core.hpp:49:0,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:157:1: error: ‘IplImage’ does not name a type
CVAPI(IplImage*) cvCloneImage( const IplImage* image );
^
In file included from /usr/local/include/opencv2/core/utility.hpp:1271:0,
from /usr/local/include/opencv2/core.hpp:3280,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:169:29: error: variable or field ‘cvSetImageCOI’ declared void
CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
^
/usr/local/include/opencv2/core/core_c.h:169:29: error: ‘IplImage’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:169:39: error: ‘image’ was not declared in this scope
CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
^
/usr/local/include/opencv2/core/core_c.h:169:46: error: expected primary-expression before ‘int’
CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
^
/usr/local/include/opencv2/core/core_c.h:177:34: error: ‘IplImage’ does not name a type
CVAPI(int) cvGetImageCOI( const IplImage* image );
^
/usr/local/include/opencv2/core/core_c.h:190:29: error: variable or field ‘cvSetImageROI’ declared void
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
^
/usr/local/include/opencv2/core/core_c.h:190:29: error: ‘IplImage’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:190:39: error: ‘image’ was not declared in this scope
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
^
/usr/local/include/opencv2/core/core_c.h:190:46: error: ‘CvRect’ was not declared in this scope
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
^
/usr/local/include/opencv2/core/core_c.h:201:31: error: variable or field ‘cvResetImageROI’ declared void
CVAPI(void) cvResetImageROI( IplImage* image );
^
/usr/local/include/opencv2/core/core_c.h:201:31: error: ‘IplImage’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:201:41: error: ‘image’ was not declared in this scope
CVAPI(void) cvResetImageROI( IplImage* image );
^
In file included from /usr/include/opencv2/core/core.hpp:49:0,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:208:1: error: ‘CvRect’ does not name a type
CVAPI(CvRect) cvGetImageROI( const IplImage* image );
^
In file included from /usr/local/include/opencv2/core/utility.hpp:1271:0,
from /usr/local/include/opencv2/core.hpp:3280,
from /usr/local/include/opencv2/core/types_c.h:101,
from /usr/include/opencv2/core/core.hpp:49,
from opencv_mat.cpp:789:
/usr/local/include/opencv2/core/core_c.h:298:32: error: variable or field ‘cvDecRefData’ declared void
CV_INLINE void cvDecRefData( CvArr* arr )
^
/usr/local/include/opencv2/core/core_c.h:298:32: error: ‘CvArr’ was not declared in this scope
/usr/local/include/opencv2/core/core_c.h:298:39: error: ‘arr’ was not declared in this scope
CV_INLINE void cvDecRefData( CvArr* arr )
^
In file included from opencv_mat.cpp:793:0:
/usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line
/usr/include/c++/5/typeinfo:39:37: error: expected declaration before end of line
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/opt/conda/envs/maskrcnn/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-qqkxalw5/opencv-mat/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-p1y930co/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-qqkxalw5/opencv-mat/
Hi, I have tried to use Instaboost according to the demo of YOLACT in Maskrcnn of Tensorflow version. The original model mask mAP is 0.360. All I did is as follows:
image = dataset.load_image(image_id)
aug_flag = np.random.choice([0,1],p=[0.5,0.5])
if is_train == True and aug_flag == 1:
target = dataset.image_info[image_id]["annotations"]
target, image = get_new_data(target, image, None, background=None)
crowd = [x for x in target if ('iscrowd' in x and x['iscrowd'])]
target = [x for x in target if not ('iscrowd' in x and x['iscrowd'])]
target += crowd
dataset.image_info[image_id]["annotations"] = target# need to change
But the final mask mAP is not larger than the original one. The largest training result boost I got is 0.5mAP. But I doubt this is owing to the bigger mini-batch. Can you tell me where it goes wrong?
My training params are as follows:
Any suggestions will be appreciated!
Thanks
from the model zoo, the model trained using instaboost is using 4x lr schedule. but the compared one is using 1x. it is fair to compare them?
If i don't have instance mask label, and i replace instance mask label with bbox will this work?
My python version is 3.5.6. When i have instaboost imported, the following error occurred:
python: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted
Thank u very much!
After pip installing instaboost, I tried to import in python, but segmentation fault happens.
python
Python 3.7.2 (default, Dec 29 2018, 06:19:36)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import instaboost
Segmentation fault
I use get_new_data to genrate image. but for a 1300X2600 image, it takse 7 seconds. Is this normal?
one picture cost 1s on average..
preprocess = 0.04111599922180176
instaboost = 0.9120709896087646
preprocess = 0.023632526397705078
instaboost = 0.2705254554748535
instaboost = 1.2194056510925293
preprocess = 0.030213356018066406
preprocess = 0.031014442443847656
instaboost = 0.5391912460327148
preprocess = 0.009119987487792969
instaboost = 0.7795922756195068
preprocess = 0.08683609962463379
instaboost = 0.9073679447174072
instaboost = 1.1515531539916992
preprocess = 0.011395692825317383
preprocess = 0.12354302406311035
instaboost = 0.8408169746398926
preprocess = 0.010410070419311523
instaboost = 0.668351411819458
preprocess = 0.0333857536315918
instaboost = 0.7038695812225342
instaboost = 1.3578264713287354
preprocess = 0.12049746513366699
preprocess = 0.13341665267944336
instaboost = 1.4019551277160645
preprocess = 0.013040304183959961
instaboost = 1.5061841011047363
preprocess = 0.0871119499206543
instaboost = 1.1349220275878906
instaboost = 0.4259028434753418
preprocess = 0.10847687721252441
preprocess = 0.11221194267272949
instaboost = 0.9127352237701416
preprocess = 0.02018260955810547
instaboost = 0.5885348320007324
instaboost = 0.7217702865600586
preprocess = 0.025765180587768555
preprocess = 0.032164812088012695
instaboost = 1.0032260417938232
preprocess = 0.017023086547851562
If there is no annotation of instances, can this method be used for pure object detection? If so, how can I change the code? I am using mmdetection with PASCAL VOC dataset now,thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.