Skip to content

Commit

Permalink
Add files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksanjeevan committed Jun 25, 2018
1 parent a8d2b6b commit 0ee9dd5
Show file tree
Hide file tree
Showing 19 changed files with 1,925 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.h5
__pycache__/
.DS_Store
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Pretrained COCO/VOC keras models can be downloaded [here](https://drive.google.c


##### *conf*
Pass a config.json file that looks like this:
Pass a config.json file that looks like this (minus the comments!):

```
{
Expand Down Expand Up @@ -119,7 +119,7 @@ Example:
python3 dourflow.py theoffice.png -m coco_model.h5 -c coco_config.json -t 0.35
```
<p align="center">
<img src="result_plots/batchex.png" width="400px"/>
<img src="result_plots/batchex.png" width="500px"/>
</p>


Expand Down
Empty file added __init__.py
Empty file.
33 changes: 33 additions & 0 deletions confs/config_coco.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"model" : {
"input_size": 416,
"grid_size": 13,
"true_box_buffer": 30,
"iou_threshold": 0.5,
"nms_threshold": 0.3
},
"config_path" : {
"labels": "models/coco/labels_coco.txt",
"anchors": "models/coco/anchors_coco.txt",
"arch_plotname": ""
},
"train": {
"out_model_name": "",
"image_folder": "",
"annot_folder": "",
"batch_size": 16,
"learning_rate": 1e-4,
"num_epochs": 20,
"object_scale": 5.0 ,
"no_object_scale": 1.0,
"coord_scale": 1.0,
"class_scale": 1.0,
"verbose": 1
},

"valid": {
"image_folder": "",
"annot_folder": "",
"pred_folder": ""
}
}
34 changes: 34 additions & 0 deletions confs/config_voc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"model" : {
"input_size": 416,
"grid_size": 13,
"true_box_buffer": 10,
"iou_threshold": 0.5,
"nms_threshold": 0.3
},
"config_path" : {
"labels": "models/voc/labels_voc.txt",
"anchors": "models/voc/anchors_voc.txt",
"arch_plotname": ""
},
"train": {
"out_model_name": "yolo_retrained_voc.h5",
"image_folder": "/home/kiran/Documents/DATA/VOC/train/imgs",
"annot_folder": "/home/kiran/Documents/DATA/VOC/train/anns",
"batch_size": 16,
"learning_rate": 1e-4,
"num_epochs": 20,
"object_scale": 5.0 ,
"no_object_scale": 1.0,
"coord_scale": 1.0,
"class_scale": 1.0,
"verbose": 1
},

"valid": {
"image_folder": "/home/kiran/Documents/DATA/VOC/valid/imgs",
"annot_folder": "/home/kiran/Documents/DATA/VOC/valid/anns",
"pred_folder": "/home/kiran/Documents/DATA/VOC/valid/img_pred",
"plot_preds": true
}
}
22 changes: 22 additions & 0 deletions dourflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

from net.netarch import generate_model
from net.netparams import YoloParams
from yolov2 import YoloV2, YoloInferenceModel
import os


# Add CPU option
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"


if __name__ == '__main__':

if YoloParams.WEIGHT_FILE:
generate_model()

else:
YoloV2().run()



1 change: 1 addition & 0 deletions models/coco/anchors_coco.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828
80 changes: 80 additions & 0 deletions models/coco/labels_coco.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
person
bicycle
car
motorcycle
airplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
couch
potted plant
bed
dining table
toilet
tv
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush
1 change: 1 addition & 0 deletions models/voc/anchors_voc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3221, 1.73145, 3.19275, 4.00944, 5.05587, 8.09892, 9.47112, 4.84053, 11.2364, 10.0071
20 changes: 20 additions & 0 deletions models/voc/labels_voc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
aeroplane
bicycle
bird
boat
bottle
bus
car
cat
chair
cow
diningtable
dog
horse
motorbike
person
pottedplant
sheep
sofa
train
tvmonitor
Empty file added net/__init__.py
Empty file.
Loading

0 comments on commit 0ee9dd5

Please sign in to comment.