Skip to content

Commit

Permalink
Merge pull request #909 from anarkiwi/doc2
Browse files Browse the repository at this point in the history
yolov8 example.
  • Loading branch information
anarkiwi authored Oct 10, 2023
2 parents c7ebcc5 + e389772 commit 9f3447b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docker/Dockerfile.torchserve
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@ RUN pip config set global.no-cache-dir false && \
cd .. && \
rm -rf serve
RUN /usr/local/bin/torchserve --help

## example usage with YOLOv8 (https://github.com/pytorch/serve/tree/v0.8.2/examples/object_detector/yolo/yolov8):

# docker build -f Dockerfile.torchserve . -ts iqtlabs/gamutrf-torchserve
# docker run -ti iqtlabs/gamutrf-torchserve bash
# apt-get update && apt-get install -y curl wget
# pip3 install torch-model-archiver
# cd /tmp
# git clone https://github.com/pytorch/serve -b v0.8.2
# cd serve/examples/object_detector/yolo/yolov8
# pip install -r requirements.txt
# wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
# torch-model-archiver --model-name yolov8n --version 1.0 --serialized-file yolov8n.pt --handler custom_handler.py
# mkdir model_store
# mv yolov8n.mar model_store/.
# torchserve --start --model-store model_store --ncs
# curl -X POST "localhost:8081/models?model_name=yolov8n&url=yolov8n.mar&initial_workers=4&batch_size=2"
# curl http://127.0.0.1:8080/predictions/yolov8n -T persons.jpg & curl http://127.0.0.1:8080/predictions/yolov8n -T bus.jpg

0 comments on commit 9f3447b

Please sign in to comment.