Commit
·
dd59460
1
Parent(s):
c90fc3f
Add Multi-Car dataset and update model loading in run.py
Browse files- Added the Multi-Car dataset to the Dockerfile for inclusion in the build.
- Updated run.py to pre-load the Multi-Car detection model alongside the State Farm model, enhancing the application's capabilities.
- Dockerfile +2 -0
- run.py +2 -0
Dockerfile
CHANGED
|
@@ -30,6 +30,8 @@ COPY samples/ ./samples/
|
|
| 30 |
# Copy State Farm dataset
|
| 31 |
COPY datasets/state-farm/ ./datasets/state-farm/
|
| 32 |
|
|
|
|
|
|
|
| 33 |
# Set environment variables
|
| 34 |
ENV PYTHONUNBUFFERED=1
|
| 35 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
|
|
|
| 30 |
# Copy State Farm dataset
|
| 31 |
COPY datasets/state-farm/ ./datasets/state-farm/
|
| 32 |
|
| 33 |
+
# Copy Multi-Car dataset
|
| 34 |
+
COPY datasets/multi-car/ ./datasets/multi-car/
|
| 35 |
# Set environment variables
|
| 36 |
ENV PYTHONUNBUFFERED=1
|
| 37 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
run.py
CHANGED
|
@@ -56,9 +56,11 @@ if __name__ == "__main__":
|
|
| 56 |
try:
|
| 57 |
from app.services.pipeline import get_pipeline
|
| 58 |
from app.models.state_farm_model import get_state_farm_detector
|
|
|
|
| 59 |
logger.info("📦 Loading pipeline and all models...")
|
| 60 |
pipeline = get_pipeline() # This will load all models
|
| 61 |
state_farm_detector = get_state_farm_detector() # Pre-load State Farm model
|
|
|
|
| 62 |
logger.info(f"✅ All models loaded successfully in {time.time() - startup_start:.2f}s")
|
| 63 |
except Exception as e:
|
| 64 |
logger.warning(f"⚠️ Warning: Could not pre-load models: {e}")
|
|
|
|
| 56 |
try:
|
| 57 |
from app.services.pipeline import get_pipeline
|
| 58 |
from app.models.state_farm_model import get_state_farm_detector
|
| 59 |
+
from app.models.multi_car_detector import get_multi_car_detector
|
| 60 |
logger.info("📦 Loading pipeline and all models...")
|
| 61 |
pipeline = get_pipeline() # This will load all models
|
| 62 |
state_farm_detector = get_state_farm_detector() # Pre-load State Farm model
|
| 63 |
+
multi_car_detector = get_multi_car_detector() # Pre-load Multi-Car Detection model
|
| 64 |
logger.info(f"✅ All models loaded successfully in {time.time() - startup_start:.2f}s")
|
| 65 |
except Exception as e:
|
| 66 |
logger.warning(f"⚠️ Warning: Could not pre-load models: {e}")
|