coreml-service-yolov8/Sources/App/routes.swift
2024-04-29 10:14:34 +02:00

12 lines
342 B
Swift

import Vapor
func routes(_ app: Application) throws {
var modelsPath = ""
if Environment.get("MODELS_PATH") != nil {
modelsPath = Environment.get("MODELS_PATH")!
}
let recoController = RecognitionController(modelsPath: modelsPath)
try app.register(collection: recoController)
try recoController.loadModel()
}