Spaces:
Running
Running
ThongAccount
commited on
Commit
·
a884613
1
Parent(s):
2f9be48
Adds the model files
Browse files- Dockerfile +12 -1
- app/detect.py +1 -1
- app/yolov8l.pt +3 -0
- app/yolov8x.pt +3 -0
- app/yolov8x6.pt +3 -0
Dockerfile
CHANGED
@@ -1,10 +1,21 @@
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
|
|
|
|
|
|
|
|
3 |
WORKDIR /app
|
4 |
|
|
|
|
|
5 |
COPY requirements.txt .
|
|
|
|
|
6 |
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
|
8 |
-
|
|
|
9 |
|
|
|
10 |
CMD ["python", "app/main.py"]
|
|
|
1 |
+
# Use a lightweight Python image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Install system dependencies for OpenCV
|
5 |
+
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
|
6 |
+
|
7 |
+
# Set working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Copy app files
|
11 |
+
COPY app/ ./app/
|
12 |
COPY requirements.txt .
|
13 |
+
|
14 |
+
# Install Python dependencies
|
15 |
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
|
17 |
+
# Expose port
|
18 |
+
EXPOSE 7860
|
19 |
|
20 |
+
# Command to run the app
|
21 |
CMD ["python", "app/main.py"]
|
app/detect.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from ultralytics import YOLO
|
2 |
|
3 |
# Load model 1 lần duy nhất khi import detect.py
|
4 |
-
model = YOLO("
|
5 |
|
6 |
def predict_image_bytes(image_bytes):
|
7 |
results = model(image_bytes, imgsz=640)
|
|
|
1 |
from ultralytics import YOLO
|
2 |
|
3 |
# Load model 1 lần duy nhất khi import detect.py
|
4 |
+
model = YOLO("app/yolov8x6.pt")
|
5 |
|
6 |
def predict_image_bytes(image_bytes):
|
7 |
results = model(image_bytes, imgsz=640)
|
app/yolov8l.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:18218ea4798da042d9862e6029ca9531adbd40ace19b6c9a75e2e28f1adf30cc
|
3 |
+
size 87769683
|
app/yolov8x.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c4d5a3f000d771762f03fc8b57ebd0aae324aeaefdd6e68492a9c4470f2d1e8b
|
3 |
+
size 136867539
|
app/yolov8x6.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:565a1ee7c0b3d230cd63ecf37ca8de1b752c8c14661ecbc72788986401904535
|
3 |
+
size 195529012
|