Skip to content

Instantly share code, notes, and snippets.

@dgtlmoon
Last active May 23, 2020 14:46
Show Gist options
  • Save dgtlmoon/15e131b8cf5ab67b38489924fd5f2a1f to your computer and use it in GitHub Desktop.
Save dgtlmoon/15e131b8cf5ab67b38489924fd5f2a1f to your computer and use it in GitHub Desktop.
#!/bin/bash
#change base_lr
#note nclasses bases+count
curl -X DELETE "http://localhost:8080/services/tag_detect?clear=all"
sleep 1
docker stop dd_tags
docker rm dd_tags
nvidia-docker run --name dd_tags -d -p 8080:8080 -v "`pwd`":/tags_dataset jolibrain/deepdetect_gpu
sleep 2
rm models/ssd300/*txt models/ssd300/*json models/ssd300/model*
rm -rf models/ssd300/*lmdb
sleep 1
curl -X PUT "http://localhost:8080/services/tag_detect" -d '{
"mllib": "caffe",
"description": "tag detector",
"type": "supervised",
"parameters": {
"input": {
"connector": "image",
"db": true,
"bbox": true,
"img_width":300,
"img_height":300,
"db_width":512,
"db_height":512
},
"mllib": {
"template": "ssd_300",
"finetuning": true,
"weights": "/tags_dataset/models/ssd300/VGG_ILSVRC_16_layers_fc_reduced.caffemodel",
"nclasses": 3,
"rotate": true,
"mirror": true,
"db": true,
"noise": {
"all_effects": true,
"prob": 0.001
},
"distort": {
"all_effects": true,
"prob": 0.5
},
"geometry": {
"persp_horizontal": true,
"persp_vertical": true,
"pad_mode": "MIRRORED",
"persp_factor": 0.25,
"zoom_factor": 0.25,
"prob": 0.0
},
"gpu": true
},
"output":{ "confidence_threshold":0.3, "bbox": true }
},
"model": {
"templates": "../templates/caffe/",
"repository": "/tags_dataset/models/ssd300",
"create_repository": true
}
}'
sleep 2
curl -X POST "http://localhost:8080/train" -d '{
"service": "tag_detect",
"async": true,
"parameters": {
"input": {
"shuffle": true,
"db": true,
"db_width": 512,
"db_height": 512,
"width":300,
"height":300
},
"mllib": {
"gpu": true,
"resume": false,
"net": {
"batch_size": 32,
"test_batch_size": 1
},
"solver": {
"iterations": 80000,
"test_interval": 1000,
"snapshot": 1000,
"base_lr": 0.001,
"solver_type": "ADAMSW",
"iter_size": 1
},
"bbox": true
},
"output": {
"measure": [
"map"
]
}
},
"data": [
"/tags_dataset/train.txt",
"/tags_dataset/test.txt"
]
}'
curl -X GET "http://localhost:8080/train?service=tag_detect&job=1"|python -mjson.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment