Skip to content

Can't use tflite backend #5

Description

@hillz2

I tried to test the tflite backend:

root@at-work:/mnt/mmcblk2p4/stacks/other-stack # curl -X POST 'http://192.168.2.1:8000/api/v1/detect?backend=tflite&confidence_threshold=0.50&return_image=false' -F 'file=@/tmp/img.jpeg'
{"detail":"Backend initialization error: Backend 'tflite' not found. Available backends: ['onnx', 'opencv']"}#                                                                                                     root@at-work:/mnt/mmcblk2p4/stacks/other-stack # docker exec -it light-object-detect bash
root@86c0ed470f79:/app# python scripts/download_model.py
Ensuring default TFLite model for object detection...
Model and labels already exist.
Done.
root@86c0ed470f79:/app# ls -lh backends/tflite/models/
total 4.0M
-rw-r--r-- 1 root root  621 May 22 13:31 labelmap.txt
-rw-r--r-- 1 root root 4.0M May 22 13:31 ssd_mobilenet_v1.tflite
root@86c0ed470f79:/app# 

I'm running this on an android tv box that's installed with OpenWrt and docker, I can only use onnx at the moment and it's very CPU heavy for my tv box. This is my compose.yaml file:

  light-object-detect:
    build: https://github.com/opensensor/light-object-detect.git
    container_name: light-object-detect
    dns:
      - 8.8.8.8
      - 1.1.1.1
    ports:
      - "8000:8000"
    environment:
      - BACKEND=tflite
      - TFLITE_MODEL_PATH=backends/tflite/models/ssd_mobilenet_v1.tflite
      - TFLITE_LABELS_PATH=backends/tflite/models/labelmap.txt
      - TFLITE_CONFIDENCE_THRESHOLD=0.5
    volumes:
      - ./lightnvr/data/models:/app/backends/opencv/models/
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 750M

How can I use tflite ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions