-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (36 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Define base images
ARG app_image="ultralytics/yolov5:latest"
# App image:
FROM ${app_image}
WORKDIR /usr/src/app
# Install api requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir pretrainedmodels
# Get weights
#RUN python3 -c "from utils.google_utils import *; \
#attempt_download('weights/yolov5s.pt'); \
#attempt_download('weights/yolov5m.pt'); \
#attempt_download('weights/yolov5l.pt'); \
#attempt_download('weights/yolov5x.pt'); \
#attempt_download('weights/yolov3-spp.pt')"
RUN ./weights/download_weights.sh
# Model to use (defaults to yolov5):
ARG weights_file="weights/yolov5l.pt"
ARG config_file="cfg/yolov4.cfg"
ARG meta_file="cfg/coco.data"
ARG img_size=640
ENV weights_file=${weights_file}
ENV config_file=${config_file}
ENV meta_file=${meta_file}
ENV img_size=${img_size}
ENV optimized_memory=${optimized_memory}
ENV augment=False
ENV agnostic_nms=False
ENV device=
ENV half=False
ENV iou_thres=0.5
ENV classify=False
COPY app.py .
COPY swagger.yaml .
CMD ["python3", "app.py"]