-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#patch: support tpu compatible docker image
# Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Fri Aug 4 16:51:36 2023 -0700 # # On branch main # Your branch and 'origin/main' have diverged, # and have 1 and 1 different commits each, respectively. # (use "git pull" to merge the remote branch into yours) # # Changes to be committed: # modified: .github/workflows/deploy.yaml # new file: Dockerfile.gpu # new file: requirements.gpu.txt # # Changes not staged for commit: # modified: .github/workflows/deploy.yaml # modified: Dockerfile # deleted: Dockerfile.gpu # deleted: requirements.gpu.txt # # Untracked files: # Dockerfile.tpu # requirements.tpu.txt #
- Loading branch information
Showing
8 changed files
with
124 additions
and
8 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 @@ | ||
__pycache__ | ||
*.pt |
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
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,31 @@ | ||
ARG ULTRALYTICS_TAG | ||
ARG MODEL=yolov8s.pt | ||
|
||
FROM ultralytics/ultralytics:latest-cpu AS EXPORT | ||
ARG MODEL | ||
ENV WORKDIR=/opt/cv-notifier | ||
WORKDIR $WORKDIR | ||
COPY . . | ||
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \ | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ | ||
curl -sL https://github.com/ultralytics/assets/releases/download/v0.0.0/$MODEL -o $MODEL && \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y libedgetpu1-std edgetpu-compiler cmake libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 tzdata && \ | ||
pip3 install -r requirements.tpu.build.txt --no-cache-dir && \ | ||
yolo export model=$MODEL format="edgetpu" | ||
|
||
FROM ultralytics/ultralytics:$ULTRALYTICS_TAG | ||
ENV WORKDIR=/opt/cv-notifier \ | ||
EDGETPU_ENABLED=true | ||
WORKDIR $WORKDIR | ||
COPY . . | ||
COPY --from=EXPORT $WORKDIR/yolov8s_saved_model/* . | ||
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \ | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y libedgetpu1-std libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 tzdata && \ | ||
apt-get upgrade -y && \ | ||
apt-get autoremove -y && \ | ||
pip3 install -r requirements.tpu.txt --no-cache-dir | ||
|
||
CMD ["python3", "main.py"] |
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
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,5 @@ | ||
# Export tooling | ||
onnx >= 1.12.0 # ONNX export | ||
onnxsim >= 0.4.1 # ONNX simplifier | ||
tensorflow >= 2.4.1 # TF exports (-cpu, -aarch64, -macos) | ||
tflite-support >= 0.4.4 |
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,5 @@ | ||
ultralytics >= 8.0.106 | ||
schema >= 0.7.5 | ||
requests >= 2.31.0 | ||
loguru >= 0.7.0 | ||
--extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0 |