Summary
In detect_adapter.py, the custom command checks a cache that only the list-custom command ever populates. After the module process starts, every /v1/vision/custom/<model> request fails with "No custom models found" until something calls /v1/vision/custom/list at least once.
Current main, lines 125-128:
elif data.command == "custom": # Perform custom object detection
if not self.custom_model_names:
return { "success": False, "error": "No custom models found" }
self.custom_model_names is initialised to [] (line 25) and is assigned only inside _list_custom_models() (line 208), which is reached only from the list-custom branch (line 97). The custom branch reads the cache but never fills it.
Impact
This is the cause of the recurring "Blue Iris suddenly reports nothing found" reports, e.g. codeproject/CodeProject.AI-Server#311 (currently marked answered with "update Blue Iris" / "restart Windows" — both of which work only because they restart Blue Iris, which makes it re-enumerate models and call list-custom).
It is hard to spot because /v1/status/ping keeps returning 200, so Blue Iris reports the server online and simply logs every alert as Alert canceled [nothing found]. A client configured for custom models only sees 100% detection failure with no error surfaced anywhere obvious.
The older ObjectDetectionYOLOv5-6.2 adapter has no such guard in its custom branch, so this is a regression introduced with the YOLOv8 module. That is also why "revert to YOLOv5" circulates as a workaround.
Reproduction
- Place a custom model (e.g.
ipcam-general.pt) in custom-models/.
- Restart the module (or the container).
- Without calling
/v1/vision/custom/list, POST an image to /v1/vision/custom/ipcam-general.
Actual:
{"success":false,"error":"No custom models found","code":500,"moduleId":"ObjectDetectionYOLOv8"}
Then POST /v1/vision/custom/list and repeat step 3 — it now succeeds and runs inference normally.
A useful tell in the failing state is latency: the error path returns in ~10-20ms where real inference takes ~200-300ms.
Suggested fix
Populate the cache on demand. _list_custom_models() already rate-limits itself to one scandir per 60s, so this costs nothing in the steady state:
elif data.command == "custom": # Perform custom object detection
if not self.custom_model_names:
self._list_custom_models()
if not self.custom_model_names:
return { "success": False, "error": "No custom models found" }
PR to follow.
Environment
- CodeProject.AI Server 2.9.5 (Docker,
codeproject/ai-server:cuda12_2)
- ObjectDetectionYOLOv8 1.6.2, GPU (CUDA)
- Client: Blue Iris 5.x configured for custom models only
Summary
In
detect_adapter.py, thecustomcommand checks a cache that only thelist-customcommand ever populates. After the module process starts, every/v1/vision/custom/<model>request fails with"No custom models found"until something calls/v1/vision/custom/listat least once.Current
main, lines 125-128:self.custom_model_namesis initialised to[](line 25) and is assigned only inside_list_custom_models()(line 208), which is reached only from thelist-custombranch (line 97). Thecustombranch reads the cache but never fills it.Impact
This is the cause of the recurring "Blue Iris suddenly reports nothing found" reports, e.g. codeproject/CodeProject.AI-Server#311 (currently marked answered with "update Blue Iris" / "restart Windows" — both of which work only because they restart Blue Iris, which makes it re-enumerate models and call
list-custom).It is hard to spot because
/v1/status/pingkeeps returning 200, so Blue Iris reports the server online and simply logs every alert asAlert canceled [nothing found]. A client configured for custom models only sees 100% detection failure with no error surfaced anywhere obvious.The older
ObjectDetectionYOLOv5-6.2adapter has no such guard in itscustombranch, so this is a regression introduced with the YOLOv8 module. That is also why "revert to YOLOv5" circulates as a workaround.Reproduction
ipcam-general.pt) incustom-models/./v1/vision/custom/list, POST an image to/v1/vision/custom/ipcam-general.Actual:
{"success":false,"error":"No custom models found","code":500,"moduleId":"ObjectDetectionYOLOv8"}Then
POST /v1/vision/custom/listand repeat step 3 — it now succeeds and runs inference normally.A useful tell in the failing state is latency: the error path returns in ~10-20ms where real inference takes ~200-300ms.
Suggested fix
Populate the cache on demand.
_list_custom_models()already rate-limits itself to onescandirper 60s, so this costs nothing in the steady state:PR to follow.
Environment
codeproject/ai-server:cuda12_2)