mirror of
https://github.com/foomo/coreml-service-yolov8.git
synced 2025-10-16 12:25:42 +00:00
feat: support to read MODELS_PATH env var
This commit is contained in:
parent
928b96cc20
commit
97b19facad
@ -6,10 +6,8 @@ enum Entrypoint {
|
||||
static func main() async throws {
|
||||
var env = try Environment.detect()
|
||||
try LoggingSystem.bootstrap(from: &env)
|
||||
|
||||
let app = Application(env)
|
||||
defer { app.shutdown() }
|
||||
|
||||
do {
|
||||
try await configure(app)
|
||||
} catch {
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
import Vapor
|
||||
|
||||
func routes(_ app: Application) throws {
|
||||
let recoController = RecognitionController(modelsPath: "")
|
||||
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()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user