File size: 964 Bytes
157d1a7
 
6bb3589
 
 
 
 
 
157d1a7
 
 
 
6bb3589
 
 
 
 
 
 
 
 
 
 
 
404cd12
 
 
6bb3589
 
157d1a7
6bb3589
 
404cd12
6bb3589
 
8eca4c1
6bb3589
616addd
 
8eca4c1
 
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
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

# Use the official Python image as the base
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    ffmpeg \
    libsm6 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Clone YOLOv7 repository
RUN git clone https://github.com/WongKinYiu/yolov7.git

# Copy application files
COPY . .

# Modify torch.load to set weights_only=False
RUN sed -i 's/torch.load(\(.*\))/torch.load(\1, weights_only=False)/g' yolov7/models/experimental.py

# Expose the port Streamlit runs on
EXPOSE 8501

# Run the application
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
#CMD ["streamlit", "run", "app.py"]