INNER CODE UNIT · Python
startup_event
virajmavani/semi-auto-image-annotation-tool · web/backend/main.py:161
async def startup_event():
"""Initialize model on startup"""
global current_model
try:
# Scan for custom models
scan_custom_models()
print(f"Found {len(AVAILABLE_MODELS)} available models")
# Load default model
current_model = ModelFactory.create_model(current_model_type, threshold=current_threshold)
print(f"Model {current_model_type} loaded successfully")
except Exception as e:
print(f"Error loading model: {e}")
@app.get("/api/models")
async def get_models():