Files
ProjectIOT/server.py
2025-04-25 16:33:01 +02:00

22 lines
468 B
Python

from ultralytics.nn.tasks import DetectionModel # type: ignore
import torch
from application import app
from application.api.views import api_blueprint
torch.serialization.add_safe_globals( # type: ignore
{"DetectionModel": DetectionModel} # type: ignore
)
app.register_blueprint(api_blueprint)
# Default app route
@app.route("/")
def home():
return "Hello, World!"
if __name__ == "__main__":
app.run(host="192.168.137.1", port=2222, debug=True)