Skip to content

Commit

Permalink
moving maskApi.* and gason.* to common/, some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
pdollar committed Apr 28, 2016
1 parent 3ac47c7 commit 30b5058
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 16 deletions.
21 changes: 11 additions & 10 deletions MatlabAPI/MaskApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
% For crowd gt regions we use this modified criteria above for the iou.
%
% To compile use the following (some precompiled binaries are included):
% mex('CFLAGS=\$CFLAGS -Wall -std=c99','private/maskApi.c',...
% 'private/maskApiMex.c','-largeArrayDims','-outdir','private');
% mex('CFLAGS=\$CFLAGS -Wall -std=c99','-largeArrayDims',...
% 'private/maskApiMex.c','../common/maskApi.c',...
% '-I../common/','-outdir','private');
% Please do not contact us for help with compiling.
%
% Microsoft COCO Toolbox. version 2.0
Expand All @@ -74,35 +75,35 @@

methods( Static )
function Rs = encode( masks )
Rs = maskApi( 'encode', masks );
Rs = maskApiMex( 'encode', masks );
end

function masks = decode( Rs )
masks = maskApi( 'decode', Rs );
masks = maskApiMex( 'decode', Rs );
end

function R = merge( Rs, varargin )
R = maskApi( 'merge', Rs, varargin{:} );
R = maskApiMex( 'merge', Rs, varargin{:} );
end

function o = iou( dt, gt, varargin )
o = maskApi( 'iou', dt', gt', varargin{:} );
o = maskApiMex( 'iou', dt', gt', varargin{:} );
end

function a = area( Rs )
a = maskApi( 'area', Rs );
a = maskApiMex( 'area', Rs );
end

function bbs = toBbox( Rs )
bbs = maskApi( 'toBbox', Rs )';
bbs = maskApiMex( 'toBbox', Rs )';
end

function Rs = frBbox( bbs, h, w )
Rs = maskApi( 'frBbox', bbs', h, w );
Rs = maskApiMex( 'frBbox', bbs', h, w );
end

function R = frPoly( poly, h, w )
R = maskApi( 'frPoly', poly, h , w );
R = maskApiMex( 'frPoly', poly, h , w );
end
end

Expand Down
6 changes: 4 additions & 2 deletions MatlabAPI/gason.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
% Gason requires C++11 to compile (for GCC this requires version 4.7 or
% later). The following command compiles the parser (may require tweaking):
% mex('CXXFLAGS=\$CXXFLAGS -std=c++11 -Wall','-largeArrayDims',...
% 'private/gasonMex.cpp','private/gason.cpp','-outdir','private');
% 'private/gasonMex.cpp','../common/gason.cpp',...
% '-I../common/','-outdir','private');
% Note the use of the "-std=c++11" flag. A number of precompiled binaries
% are included, please do not contact us for help with compiling.
% are included, please do not contact us for help with compiling. If needed
% you can specify a compiler by adding the option 'CXX="/usr/bin/g++"'.
%
% Note that by default JSON arrays that contain only numbers are stored as
% regular Matlab arrays. Likewise, JSON arrays that contain only objects of
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion PythonAPI/pycocotools/_mask.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# distutils: language = c
# distutils: sources = ../MatlabAPI/private/maskApi.c
# distutils: sources = ../common/maskApi.c

#**************************************************************************
# Microsoft COCO Toolbox. version 2.0
Expand Down
4 changes: 2 additions & 2 deletions PythonAPI/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
ext_modules = [
Extension(
'pycocotools._mask',
sources=['../MatlabAPI/private/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../MatlabAPI/private'],
sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../common'],
extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
)
]
Expand Down
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Microsoft COCO is a large image dataset designed for object detection, segmentat
In addition to this API, please download both the COCO images and annotations in order to run the demos and use the API. Both are available on the project website.
-Please download, unzip, and place the images in: coco/images/
-Please download and place the annotations in: coco/annotations/
For substantially more details on the API please see http://mscoco.org/dataset/#download.

After downloading the images and annotations run either the Matlab or Python demos for example usage.

To install Python API, run "python setup.py build_ext --inplace" to compile Cython code.
To install Python API, run "make" under PythonAPI.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 30b5058

Please sign in to comment.