@@ -23,7 +23,7 @@ docker run -it \
23
23
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
24
24
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
25
25
dl-darknet:local \
26
- /bin/sh -c " cd /darknet; ./darknet detector test cfg/coco.data cfg/yolov3-tiny.cfg weight/yolov3-tiny.weights data/dog.jpg -dont_show > image/dog.log"
26
+ detector test cfg/coco.data cfg/yolov3-tiny.cfg weight/yolov3-tiny.weights data/dog.jpg -dont_show > image/dog.log
27
27
```
28
28
29
29
Detection with normal weights.
@@ -41,7 +41,7 @@ docker run -it \
41
41
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
42
42
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
43
43
dl-darknet:local \
44
- /bin/sh -c ' cd /darknet; ./darknet detector test cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights data/dog.jpg -dont_show'
44
+ detector test cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights data/dog.jpg -dont_show > image/dog2.log
45
45
```
46
46
47
47
Detection on a MP4 file.
@@ -59,7 +59,7 @@ docker run -it \
59
59
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
60
60
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
61
61
dl-darknet:local \
62
- /bin/sh -c ' cd /darknet; ./darknet detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights video/dummy.mp4 -out_filename video/dummy.avi -dont_show'
62
+ detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights video/dummy.mp4 -out_filename video/dummy.avi -dont_show
63
63
```
64
64
65
65
Detection on a MP4 file and output to JSON + MJPEG + AVI. After you run the command below, direct your browsers to the following URLs.
@@ -82,7 +82,7 @@ docker run -it \
82
82
-p 8070:8070 \
83
83
-p 8090:8090 \
84
84
dl-darknet:local \
85
- /bin/sh -c ' cd /darknet; ./darknet detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights video/dummy.mp4 -json_port 8070 -mjpeg_port 8090 -ext_output -dont_show -out_filename video/dummy.avi'
85
+ detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights video/dummy.mp4 -json_port 8070 -mjpeg_port 8090 -ext_output -dont_show -out_filename video/dummy.avi
86
86
```
87
87
88
88
Detection on a real-time video stream and redirect output to JSON + MJPEG + AVIG. Note that you can test the below by downloading and installing [ IP Webcam] ( https://play.google.com/store/apps/details?id=com.pas.webcam ) on your phone; replace the IP below with the one on your phone (the software on the phone will show you what the phone's IP is).
@@ -102,7 +102,7 @@ docker run -it \
102
102
-p 8070:8070 \
103
103
-p 8090:8090 \
104
104
dl-darknet:local \
105
- /bin/sh -c ' cd /darknet; ./darknet detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights http://192.168.0.210:8080/video?dummy=param.mjpg -json_port 8070 -mjpeg_port 8090 -ext_output -dont_show -out_filename video/dummy.avi'
105
+ detector demo cfg/coco.data cfg/yolov3.cfg weight/yolov3.weights http://192.168.0.210:8080/video? dummy=param.mjpg -json_port 8070 -mjpeg_port 8090 -ext_output -dont_show -out_filename video/dummy.avi
106
106
```
107
107
108
108
Training your own object detector.
@@ -120,7 +120,7 @@ docker run -it \
120
120
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
121
121
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
122
122
dl-darknet:local \
123
- /bin/sh -c ' cd /darknet; ./darknet detector train /darknet/image/polygons/iaia-polygons.data /darknet/image/polygons/tiny-yolo-iaia-polygons.cfg -dont_show'
123
+ detector train /darknet/image/polygons/iaia-polygons.data /darknet/image/polygons/tiny-yolo-iaia-polygons.cfg -dont_show
124
124
```
125
125
126
126
Testing your own object detector.
@@ -138,7 +138,7 @@ docker run -it \
138
138
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
139
139
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
140
140
dl-darknet:local \
141
- /bin/sh -c ' cd /darknet; ./darknet detector test /darknet/image/polygons/iaia-polygons.data /darknet/image/polygons/tiny-yolo-iaia-polygons.cfg /darknet/backup/tiny-yolo-iaia-polygons_last.weights -ext_output -dont_show -out /darknet/log/result.json < /darknet/image/polygons/iaia-polygons_valid.txt'
141
+ detector test /darknet/image/polygons/iaia-polygons.data /darknet/image/polygons/tiny-yolo-iaia-polygons.cfg /darknet/backup/tiny-yolo-iaia-polygons_last.weights -ext_output -dont_show -out /darknet/log/result.json < /darknet/image/polygons/iaia-polygons_valid.txt
142
142
```
143
143
144
144
Annotating the images with the results.
@@ -155,8 +155,9 @@ docker run -it \
155
155
-v $HOME /git/docker-containers/dl-darknet/log:/darknet/log \
156
156
-v $HOME /git/docker-containers/dl-darknet/backup:/darknet/backup \
157
157
-v $HOME /git/docker-containers/dl-darknet/scripts:/root/scripts \
158
+ --entrypoint /opt/anaconda/bin/python \
158
159
dl-darknet:local \
159
- /bin/sh -c ' /opt/anaconda/bin/python / root/scripts/annotate.py -j /darknet/log/result.json -d /darknet/image/polygons/annotations'
160
+ /root/scripts/annotate.py -j /darknet/log/result.json -d /darknet/image/polygons/annotations
160
161
```
161
162
162
163
# Use in interactive terminal mode
@@ -168,6 +169,7 @@ docker run -it \
168
169
--runtime=nvidia \
169
170
--shm-size=5g \
170
171
-e NVIDIA_VISIBLE_DEVICES=0 \
172
+ --entrypoint /bin/bash \
171
173
dl-darknet:local
172
174
```
173
175
@@ -224,9 +226,4 @@ journal={GitHub},
224
226
author={One-Off Coder},
225
227
year={2019},
226
228
month={Jul}}
227
- ```
228
-
229
- # TODO's
230
-
231
- * [ Use ENTRYPOINT and CMD] ( https://medium.com/@oprearocks/how-to-properly-override-the-entrypoint-using-docker-run-2e081e5feb9d )
232
- * [ Use WORKDIR] ( https://stackoverflow.com/questions/20632258/change-directory-command-in-docker )
229
+ ```
0 commit comments