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

bash script and Py3 fix link of coco #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,9 @@ Examples of generated masks. These then get scaled and placed on the image in th
The two functions are Non-Maximum Suppression from ruotianluo's [pytorch-faster-rcnn](https://github.com/ruotianluo/pytorch-faster-rcnn)
repository and longcw's [RoiAlign](https://github.com/longcw/RoIAlign.pytorch).

| GPU | arch |
| --- | --- |
| TitanX | sm_52 |
| GTX 960M | sm_50 |
| GTX 1070 | sm_61 |
| GTX 1080 (Ti) | sm_61 |

cd nms/src/cuda/
nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../

cd roialign/roi_align/src/cuda/
nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../../

3. As we use the [COCO dataset](http://cocodataset.org/#home) install the [Python COCO API](https://github.com/cocodataset/cocoapi) and
bash make.sh

3. As we use the [COCO dataset](http://cocodataset.org/#home) install the [Python3 fix](https://github.com/waleedka/coco) of [Python COCO API](https://github.com/cocodataset/cocoapi) and
create a symlink.

ln -s /path/to/coco/cocoapi/PythonAPI/pycocotools/ pycocotools
Expand Down
8 changes: 2 additions & 6 deletions coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,8 @@ class InferenceConfig(CocoConfig):
config.display()

# Create model
if args.command == "train":
model = modellib.MaskRCNN(config=config,
model_dir=args.logs)
else:
model = modellib.MaskRCNN(config=config,
model_dir=args.logs)
model = modellib.MaskRCNN(config=config, model_dir=args.logs)

if config.GPU_COUNT:
model = model.cuda()

Expand Down
23 changes: 23 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Which CUDA capabilities do we want to pre-build for?
# https://developer.nvidia.com/cuda-gpus
# Compute/shader model Cards
# 7.0 V100, Titan V
# 6.1 P4, P40, Titan Xp, GTX 1080 Ti, GTX 1080
# 6.0 P100
# 5.2 M40, Titan X, GTX 980
# 3.7 K80
# 3.5 K40, K20
# 3.0 K10, Grid K520 (AWS G2)
##### Please change this accordingly ########
arch = 'sm_61'
cd nms/src/cuda/
nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=$arch
cd ../../
python3 build.py
cd ../

cd roialign/roi_align/src/cuda/
nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=$arch
cd ../../
python3 build.py
cd ../../