doods2: Bird-Model with index-error. How to resolve?
Great Happiness for the new dood2!! hoped that it solved my problem with the bird-model.
https://tfhub.dev/google/lite-model/aiy/vision/classifier/birds_V1/3
as is spent the whole day to get it succesfull running in a bad python script - the new doods2 arrived. great. 🌹
doods 2 loads the model and the label-file
(csv-format with comma, but also error without commas)
but throws an error on detections in the index
some googling said: convert the model to “newer” tf-lite ?
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
INFO: 192.168.14.135:56005 - "GET / HTTP/1.1" 304 Not Modified
INFO: 192.168.14.135:56005 - "POST /image HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in __call__
raise exc
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 226, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 159, in run_endpoint_function
return await dependant.call(**values)
File "/opt/doods/api.py", line 38, in image
detect_response = self.doods.detect(detect_request)
File "/opt/doods/doods.py", line 108, in detect
ret = detector.detect(image)
File "/opt/doods/detectors/tflite.py", line 64, in detect
classes = self.interpreter.get_tensor(self.output_details[1]['index'])[0] # Class index of detected objects
IndexError: list index out of range

both label-files dont work:

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 38 (9 by maintainers)
Okay, I just made the change. It wasn’t too bad. Essentially it will tag the entire image so if you want to filter by confidence, do not put anything in the regions section, just make a broad config. This will return anything with greater than 50% confidence. FWIW, the birds model seems to return numbers between 0-100 and not 0-1 like other models. So take the confidence you want and multiply by 100. (That’s why I have 5000 to detect at 50%)