Resolve merge conflict in README.md
Browse files- Dockerfile +23 -0
- README.md +13 -0
- app/models/attribute_extractor.py +6 -0
- app/models/clothing_detector.py +5 -0
- app/models/color_analyzer.py +6 -0
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies including libGL
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
libgl1 \
|
| 8 |
+
libglib2.0-0 \
|
| 9 |
+
libsm6 \
|
| 10 |
+
libxext6 \
|
| 11 |
+
libxrender-dev \
|
| 12 |
+
libgomp1 \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
COPY requirements.txt .
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
EXPOSE 7860
|
| 22 |
+
|
| 23 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Clothing Attribute Detection
|
| 3 |
emoji: "π"
|
|
@@ -8,3 +9,15 @@ sdk_version: "latest"
|
|
| 8 |
app_file: "Dockerfile"
|
| 9 |
pinned: false
|
| 10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<<<<<<< HEAD
|
| 2 |
---
|
| 3 |
title: Clothing Attribute Detection
|
| 4 |
emoji: "π"
|
|
|
|
| 9 |
app_file: "Dockerfile"
|
| 10 |
pinned: false
|
| 11 |
---
|
| 12 |
+
=======
|
| 13 |
+
---
|
| 14 |
+
title: Clothing Attribute Detection
|
| 15 |
+
emoji: "π"
|
| 16 |
+
colorFrom: "blue"
|
| 17 |
+
colorTo: "green"
|
| 18 |
+
sdk: "docker"
|
| 19 |
+
sdk_version: "latest"
|
| 20 |
+
app_file: "Dockerfile"
|
| 21 |
+
pinned: false
|
| 22 |
+
---
|
| 23 |
+
>>>>>>> cb600bb7c71123c0b5b011b69e8b5345b1468115
|
app/models/attribute_extractor.py
CHANGED
|
@@ -4,6 +4,12 @@ from PIL import Image
|
|
| 4 |
import re
|
| 5 |
import asyncio
|
| 6 |
from typing import Dict, Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
class AttributeExtractor:
|
| 9 |
def __init__(self):
|
|
|
|
| 4 |
import re
|
| 5 |
import asyncio
|
| 6 |
from typing import Dict, Any
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# Set custom cache directory writable in Spaces environment
|
| 10 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/.cache"
|
| 11 |
+
os.environ["HF_HOME"] = "/tmp/.cache"
|
| 12 |
+
|
| 13 |
|
| 14 |
class AttributeExtractor:
|
| 15 |
def __init__(self):
|
app/models/clothing_detector.py
CHANGED
|
@@ -6,6 +6,11 @@ from PIL import Image
|
|
| 6 |
import numpy as np
|
| 7 |
from typing import List, Dict, Any
|
| 8 |
import asyncio
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
class ClothingDetector:
|
| 11 |
def __init__(self):
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
from typing import List, Dict, Any
|
| 8 |
import asyncio
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
+
# Set custom cache directory writable in Spaces environment
|
| 12 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/.cache"
|
| 13 |
+
os.environ["HF_HOME"] = "/tmp/.cache"
|
| 14 |
|
| 15 |
class ClothingDetector:
|
| 16 |
def __init__(self):
|
app/models/color_analyzer.py
CHANGED
|
@@ -5,6 +5,12 @@ from sklearn.cluster import KMeans
|
|
| 5 |
from typing import Dict, List, Any
|
| 6 |
import asyncio
|
| 7 |
import webcolors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
class ColorAnalyzer:
|
| 10 |
def __init__(self):
|
|
|
|
| 5 |
from typing import Dict, List, Any
|
| 6 |
import asyncio
|
| 7 |
import webcolors
|
| 8 |
+
import os
|
| 9 |
+
|
| 10 |
+
# Set custom cache directory writable in Spaces environment
|
| 11 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/.cache"
|
| 12 |
+
os.environ["HF_HOME"] = "/tmp/.cache"
|
| 13 |
+
|
| 14 |
|
| 15 |
class ColorAnalyzer:
|
| 16 |
def __init__(self):
|