-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup MR so its a little more professional
- Loading branch information
Showing
11 changed files
with
116 additions
and
57 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 |
---|---|---|
@@ -1,53 +1,63 @@ | ||
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS DEPENDENCIES | ||
# Base image with CUDA support | ||
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS base | ||
|
||
ARG MODEL="yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py" | ||
ARG WEIGHT="yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth" | ||
|
||
ENV FORCE_CUDA="1" | ||
ENV MMCV_WITH_OPS=1 | ||
# Set environment variables | ||
ENV FORCE_CUDA="1" \ | ||
MMCV_WITH_OPS=1 \ | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
python3-pip \ | ||
python3-pip \ | ||
libgl1-mesa-glx \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev \ | ||
libglib2.0-0 \ | ||
git \ | ||
python3-dev \ | ||
python3-wheel \ | ||
curl | ||
|
||
# Uncomment the following if you want to download a specific set of weights | ||
# RUN mkdir weights | ||
# RUN curl -o weights/$WEIGHT -L https://huggingface.co/wondervictor/YOLO-World/resolve/main/$WEIGHT | ||
|
||
RUN pip3 install --upgrade pip \ | ||
&& pip3 install wheel \ | ||
&& pip3 install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121 \ | ||
&& pip3 install \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev \ | ||
libglib2.0-0 \ | ||
git \ | ||
python3-dev \ | ||
python3-wheel \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies | ||
FROM base AS python_deps | ||
|
||
RUN pip3 install --upgrade pip wheel \ | ||
&& pip3 install --no-cache-dir torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121 \ | ||
&& pip3 install --no-cache-dir \ | ||
gradio==4.16.0 \ | ||
opencv-python==4.9.0.80 \ | ||
supervision \ | ||
mmengine==0.10.4 \ | ||
setuptools \ | ||
openmim \ | ||
onnx \ | ||
onnxsim \ | ||
&& mim install mmcv==2.1.0 \ | ||
&& mim install mmdet==3.3.0 \ | ||
&& pip install git+https://github.com/onuralpszr/mmyolo.git | ||
&& pip3 install --no-cache-dir git+https://github.com/onuralpszr/mmyolo.git | ||
|
||
# Clone and install YOLO-World | ||
FROM python_deps AS yolo_world | ||
|
||
FROM DEPENDENCIES as INSTALLING_YOLO | ||
RUN git clone --recursive https://github.com/tim-win/YOLO-World /yolo/ | ||
#COPY . /yolo | ||
RUN git clone --recursive https://github.com/wondervictor/YOLO-World /yolo/ | ||
WORKDIR /yolo | ||
|
||
RUN pip3 install -e .[demo] | ||
|
||
RUN pip3 install onnx onnxsim | ||
# Final stage | ||
FROM yolo_world AS final | ||
|
||
ARG MODEL="yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py" | ||
ARG WEIGHT="yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth" | ||
|
||
FROM INSTALLING_YOLO as OK_THIS_PART_IS_TRICKY_DONT_HATE | ||
# Create weights directory and set permissions | ||
RUN mkdir /weights/ \ | ||
&& chmod a+rwx /yolo/configs/*/* | ||
|
||
RUN mkdir /weights/ | ||
RUN chmod a+rwx /yolo/configs/*/* | ||
# Optionally download weights (commented out by default) | ||
# RUN curl -o /weights/$WEIGHT -L https://huggingface.co/wondervictor/YOLO-World/resolve/main/$WEIGHT | ||
|
||
CMD [ "bash" ] | ||
# Set the default command | ||
CMD ["bash"] |
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
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
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
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