Skip to content

Commit ae99159

Browse files
committed
Updated YoloV4 to official Github release
1 parent b98e681 commit ae99159

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,24 +208,19 @@ Using this url in a web browser will grant access to the running instance of Jup
208208

209209
It is possible to run Yolov4 using a custom container and building it from source.
210210

211-
In this example we will build [YOLOv4](https://github.com/AlexeyAB/darknet) from the source copmmit dating 2021-06-07, enabling GPU, CUDNN, OPENCV, OPENMP, the generation of the `libdarknet.so` which can be used by the `darknet.py` example as well as building additional GPU support into the container (8.6, ie RTX 30 series GPUs).
211+
In this example we will build [YOLOv4](https://github.com/AlexeyAB/darknet), enabling GPUs (61, 75 and 86 compute), CUDNN, OPENCV, OPENMP, the generation of the `libdarknet.so` which can be used by the `darknet.py` example.
212212

213213
Copy the following lines in a `Dockerfile`
214214
<pre>
215-
FROM datamachines/cudnn_tensorflow_opencv:11.2.2_2.5.0_4.5.2-20210601
216-
217-
# Pull 20210607 code
218-
RUN mkdir -p /wrk/darknet \
219-
&& cd /wrk/darknet \
220-
&& git init \
221-
&& git config --global http.sslverify false \
222-
&& git remote add origin https://github.com/AlexeyAB/darknet \
223-
&& git fetch --depth 1 origin 83e377989d1a7b86249425dc1e025ad4acff7cb7 \
224-
&& git checkout FETCH_HEAD \
225-
&& perl -i.bak -pe 's%^(GPU|CUDNN|OPENCV|OPENMP|LIBSO)=0%$1=1%g;s%(compute\_61\])%$1 -gencode arch=compute_86,code=[sm_86,compute_86]%' Makefile \
215+
FROM datamachines/cudnn_tensorflow_opencv:11.3.1_2.7.0_4.5.5-20220103
216+
217+
RUN mkdir -p /darknet \
218+
&& wget -q --no-check-certificate -c https://github.com/AlexeyAB/darknet/archive/refs/tags/yolov4.tar.gz -O - | tar --strip-components=1 -xz -C /darknet \
219+
&& cd /darknet \
220+
&& perl -i.bak -pe 's%^(GPU|CUDNN|OPENCV|OPENMP|LIBSO)=0%$1=1%g;s%(compute\_61\])%$1 -gencode arch=compute_75,code=[sm_75,compute_75] -gencode arch=compute_86,code=[sm_86,compute_86]%' Makefile \
226221
&& make
227222

228-
WORKDIR /wrk/darknet
223+
WORKDIR /darknet
229224
CMD /bin/bash
230225
</pre>
231226

@@ -240,16 +235,16 @@ CONTAINER_ID="cto_darknet:local" RUNDOCKERDIR/runDocker.sh -e "--privileged -v /
240235
, here we are telling the script to pass to the `docker` command line extra (`-e`) paramaters to run in `privileged` mode (for hardware access) and pass the webcam device (`/dev/video0`) to the container.
241236
By default, this command will also enable X11 display passthrough and mount the current directory (where the cfg and weights are) as `/dmc`.
242237

243-
Because the cfg/weights are accesible in `/dmc` and X11 and webcam can be accessed, running the following command within the newly started container (which started in `/wrk/darknet`) will start your webcam (`video0`) and run Yolo v4 on what it sees:
238+
Because the cfg/weights are accesible in `/dmc` and X11 and webcam can be accessed, running the following command within the newly started container (which started in `/darknet`) will start your webcam (`video0`) and run Yolo v4 on what it sees:
244239
<pre>
245240
./darknet detector demo cfg/coco.data /dmc/yolov4.cfg /dmc/yolov4.weights
246241
</pre>
247242

248-
For developers, in the `/wrk/darknet` you will also have the `libdarknet.so` which is needed to use `python3` with `darknet.py` and `darknet_video.py`.
243+
For developers, in `/darknet` you will also have the `libdarknet.so` which is needed to use `python3` with `darknet.py` and `darknet_video.py`.
249244

250245
#### 7.4.1. <a name='DarknetPythonbindings'></a> Darknet Python bindings
251246

252-
Darknet provides direct python bindings at this point in the form of [darknet_images.py](https://github.com/AlexeyAB/darknet/blob/master/darknet_images.py) and [darknet_video.py](https://github.com/AlexeyAB/darknet/blob/master/darknet_video.py). To test those, you have nothing to do but use the previously built container (`cto_darknet:local`) and run/adapt the following examples (in the default work directory, ie `/wrk/darknet`):
247+
Darknet provides direct python bindings at this point in the form of [darknet_images.py](https://github.com/AlexeyAB/darknet/blob/master/darknet_images.py) and [darknet_video.py](https://github.com/AlexeyAB/darknet/blob/master/darknet_video.py). To test those, you have nothing to do but use the previously built container (`cto_darknet:local`) and run/adapt the following examples (in the default work directory, ie `/darknet`):
253248

254249
`darknet_images.py` example using one of the provided images:
255250
```

0 commit comments

Comments
 (0)