WildChlamydia / MiVOLO

MiVOLO age & gender transformer neural network
308 stars 54 forks source link

Docker image #4

Open MariasStory opened 1 year ago

MariasStory commented 1 year ago

Thank you for the cool solution. Please consider adding a Docker image for CPU and for GPU.

bit-scientist commented 10 months ago

@WildChlamydia any updates on docker image addition?

Keeo commented 4 months ago
# Dockerfile
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04

LABEL description="MiVOLO"

RUN apt-get update && apt-get install --no-install-recommends -y \
    python3-dev git python3 python3-pip ffmpeg libsm6 libxext6 && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt

COPY . .
# Makefile
build:
    docker build -t mivolo:0.0.1 .

run:
    docker run --rm -it --gpus 1 -v ./demo.py:/demo.py -v ./models:/models -v ./jennifer_lawrence.jpg:/jennifer_lawrence.jpg -v ./output:/output mivolo:0.0.1 python3 demo.py \
    --input "jennifer_lawrence.jpg" \
    --output "/output" \
    --detector-weights "/models/yolov8x_person_face.pt" \
    --checkpoint "/models/mivolo_imbd.pth.tar" \
    --device "cuda:0" --device "cuda:0" --draw --with-persons