-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- start pushing to docker images to gcr.io - added a .dockerignore file - moved models and utils directory into yolo directory for better package management - fixed import paths to conform with new directory structure - added setup.py - install yolo as a package in docker image - changed the default label cache location so it doesn't mess with DVC - fixed a run-time error - use correct label name for single class - set working_dir in docker-compose.yml - add version tag to pushed image - push tagged docker image
- Loading branch information
Showing
28 changed files
with
141 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
runs | ||
weights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TAG=0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#FROM nvcr.io/nvidia/pytorch:20.06-py3 | ||
#FROM continuumio/miniconda3 | ||
#FROM gpuci/miniconda-cuda:11.0-devel-ubuntu20.04 | ||
FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04 | ||
|
||
#COPY environment.yml . | ||
#RUN conda update --force-reinstall conda | ||
#RUN conda env update --name base --file environment.yml --prune | ||
|
||
ENV MY_ROOT=/workspace \ | ||
PKG_PATH=/yolo_src \ | ||
NUMPROC=4 \ | ||
PYTHON_VER=3.8 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONPATH=. \ | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR $PKG_PATH | ||
|
||
RUN apt-get update && apt-get install -y apt-utils && apt-get -y upgrade && \ | ||
apt-get install -y git libsnappy-dev libopencv-dev libhdf5-serial-dev libboost-all-dev libatlas-base-dev \ | ||
libgflags-dev libgoogle-glog-dev liblmdb-dev curl unzip\ | ||
python${PYTHON_VER}-dev && \ | ||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | ||
python${PYTHON_VER} get-pip.py && \ | ||
rm get-pip.py && \ | ||
# Clean UP | ||
apt upgrade -y && \ | ||
apt clean && \ | ||
apt autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* # cleanup to reduce image size | ||
|
||
RUN ln -s /usr/bin/python${PYTHON_VER} /usr/bin/python | ||
|
||
RUN apt install unzip | ||
RUN pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html | ||
|
||
WORKDIR $MY_ROOT | ||
# We have to install mish-cuda from source due to an issue with one of the header files | ||
ADD https://github.com/thomasbrandon/mish-cuda/archive/master.zip $MY_ROOT/mish-cuda.zip | ||
RUN unzip mish-cuda.zip | ||
WORKDIR $MY_ROOT/mish-cuda-master | ||
RUN cp external/CUDAApplyUtils.cuh csrc/ | ||
RUN python setup.py build install | ||
WORKDIR $PKG_PATH | ||
# ADD https://drive.google.com/file/d/1NQwz47cW0NUgy7L3_xOKaNEfLoQuq3EL/view?usp=sharing /weights/yolov4-csp.weights | ||
ADD requirements.txt $PKG_PATH/requirements.txt | ||
RUN pip install -r $PKG_PATH/requirements.txt | ||
ADD yolo $PKG_PATH/yolo | ||
ADD train.py $PKG_PATH/train.py | ||
ADD test.py $PKG_PATH/test.py | ||
ADD setup.py $PKG_PATH/setup.py | ||
ADD data $PKG_PATH/data | ||
RUN pip install . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
version: '2.3' | ||
|
||
services: | ||
train: | ||
image: gcr.io/kinsol-generic/yolov4-csp:${TAG:-dev} | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
runtime: nvidia | ||
volumes: | ||
- .:/home/dev | ||
- /mnt/NAS/Production/TruckBay/:/mnt/NAS/Production/TruckBay | ||
- /mnt/NAS/Public/parque_research/datasets/coco_yolo/coco:/mnt/coco | ||
- /home/kweston/darknet_utils:/home/kweston/darknet_utils | ||
- /home/kweston/speedco/baywatchr-inference/speedco_dataset:/mnt/speedco_dataset | ||
- /home/kweston/speedco/baywatchr-inference/data/lists:/mnt/speedco_datalists | ||
- /data/kweston/sandbox/mlannotation/results:/results | ||
environment: | ||
- GOOGLE_APPLICATION_CREDENTIALS=/app/baywatchr-api-key.json | ||
command: | ||
- bash | ||
shm_size: 64g | ||
working_dir: /home/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
#!/bin/bash | ||
# Used for training with 3 GTX 1070 GPUs | ||
python -m torch.distributed.launch --nproc_per_node 3 train.py --device 0,1,2 --batch-size 21 --data speedco.yaml --weights '' --cfg yolov4-csp.cfg --name yolov4-csp-speedco --sync-bn --rect --single-cl | ||
python -m torch.distributed.launch --nproc_per_node 3 train.py --device 0,1,2 --batch-size 21 --data speedco.yaml --weights --cfg yolov4-csp-single-class.cfg --name yolov4-csp-speedco --sync-bn --rect --single-cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
from setuptools import setup, find_namespace_packages | ||
|
||
|
||
def readlines(fname): | ||
with open(os.path.join(os.path.dirname(__file__), fname)) as f: | ||
return f.readlines() | ||
|
||
|
||
install_requires = readlines('requirements.txt') | ||
|
||
|
||
setup( | ||
name='yolov4-csp', | ||
version='1.0.0', | ||
install_requires=install_requires, | ||
packages=find_namespace_packages(include=['yolo', 'yolo.*']), | ||
include_package_data=True, | ||
python_requires='>=3.7' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.