diff --git a/README.md b/README.md index 5dc669f..f161c4d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/coco.py b/coco.py index f9dc44a..47a18ce 100644 --- a/coco.py +++ b/coco.py @@ -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() diff --git a/make.sh b/make.sh new file mode 100644 index 0000000..6f20dd9 --- /dev/null +++ b/make.sh @@ -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 ../../