Skip to content

Commit

Permalink
Fix a bug; Fix some typos and update the model link in README
Browse files Browse the repository at this point in the history
  • Loading branch information
heilaw committed Mar 20, 2019
1 parent d8979eb commit 3e71377
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ Our current implementation only supports GPU so you need a GPU and need to have
### Compiling Corner Pooling Layers
You need to compile the C++ implementation of corner pooling layers.
```
cd <CornetNet dir>/models/py_utils/_cpools/
cd <CornerNet dir>/models/py_utils/_cpools/
python setup.py install --user
```

### Compiling NMS
You also need to compile the NMS code (originally from [Faster R-CNN](https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/nms/cpu_nms.pyx) and [Soft-NMS](https://github.com/bharatsingh430/soft-nms/blob/master/lib/nms/cpu_nms.pyx)).
```
cd <CornetNet dir>/external
cd <CornerNet dir>/external
make
```

### Installing MS COCO APIs
You also need to install the MS COCO APIs.
```
cd <CornetNet dir>/data
cd <CornerNet dir>/data
git clone git@github.com:cocodataset/cocoapi.git coco
cd <CornetNet dir>/data/coco/PythonAPI
cd <CornerNet dir>/data/coco/PythonAPI
make
```

### Downloading MS COCO Data
- Download the training/validation split we use in our paper from [here](https://drive.google.com/file/d/1dop4188xo5lXDkGtOZUzy2SHOD_COXz4/view?usp=sharing) (originally from [Faster R-CNN](https://github.com/rbgirshick/py-faster-rcnn/tree/master/data))
- Unzip the file and place `annotations` under `<CornetNet dir>/data/coco`
- Download the training/validation split we use in our paper from [here](https://drive.google.com/open?id=16bbMAyykdZr2_7afiMZrvvn4xkYa-LYk) (originally from [Faster R-CNN](https://github.com/rbgirshick/py-faster-rcnn/tree/master/data))
- Unzip the file and place `annotations` under `<CornerNet dir>/data/coco`
- Download the images (2014 Train, 2014 Val, 2017 Test) from [here](http://cocodataset.org/#download)
- Create 3 directories, `trainval2014`, `minival2014` and `testdev2017`, under `<CornerNet dir>/data/coco/images/`
- Copy the training/validation/testing images to the corresponding directories according to the annotation files
Expand Down
1 change: 1 addition & 0 deletions config/CornerNet.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

"border": 128,
"gaussian_bump": true,
"gaussian_iou": 0.3,

"input_size": [511, 511],
"output_sizes": [[128, 128]],
Expand Down
6 changes: 3 additions & 3 deletions sample/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ def gaussian_radius(det_size, min_overlap):
b1 = (height + width)
c1 = width * height * (1 - min_overlap) / (1 + min_overlap)
sq1 = np.sqrt(b1 ** 2 - 4 * a1 * c1)
r1 = (b1 + sq1) / 2
r1 = (b1 - sq1) / (2 * a1)

a2 = 4
b2 = 2 * (height + width)
c2 = (1 - min_overlap) * width * height
sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)
r2 = (b2 + sq2) / 2
r2 = (b2 - sq2) / (2 * a2)

a3 = 4 * min_overlap
b3 = -2 * min_overlap * (height + width)
c3 = (min_overlap - 1) * width * height
sq3 = np.sqrt(b3 ** 2 - 4 * a3 * c3)
r3 = (b3 + sq3) / 2
r3 = (b3 + sq3) / (2 * a3)
return min(r1, r2, r3)

def _get_border(border, size):
Expand Down

0 comments on commit 3e71377

Please sign in to comment.