Skip to content

Commit bb7df54

Browse files
committed
Ultralytics yolo support + some fixes
1 parent bc06628 commit bb7df54

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

.idea/API.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

robopipe_api/camera/camera.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ def delete_nn(self, sensor_name: str):
355355
if not isinstance(self.pipeline, NNPipeline):
356356
return
357357

358+
# Clear nn_config on the current sensor BEFORE the pipeline restart.
359+
# reload_sensors() propagates the old sensor's nn_config to the new
360+
# one on open(), so without this GET /nn keeps returning the deployed
361+
# config after delete — client shows a stale "NN" badge.
362+
existing = self.sensors.get(sensor_name)
363+
if existing is not None:
364+
existing.nn_config = None
365+
358366
pipeline = self.pipeline
359367
self.close()
360368
pipeline.remove_nn(sensor_name)

robopipe_api/robopipe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def hello_robopipe():
138138
return PlainTextResponse("Hello from Robopipe API!")
139139

140140

141-
@app.exception_handler(Exception)
142-
def global_exception_handler(request: Request, exc: Exception):
143-
if isinstance(exc, (CameraNotFoundException, SensorNotFoundException)):
144-
return JSONResponse(status_code=404, content=None)
141+
@app.exception_handler(CameraNotFoundException)
142+
@app.exception_handler(SensorNotFoundException)
143+
def not_found_exception_handler(request: Request, exc: Exception):
144+
return JSONResponse(status_code=404, content=None)
145145

146146

147147
def app_setup():

0 commit comments

Comments
 (0)