Giter Club home page Giter Club logo

doods2's People

Contributors

daoudeddy avatar frenetic00 avatar fusetak avatar sammy1am avatar snowzach avatar trunglam avatar turley avatar vipas-ana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doods2's Issues

Does DOODs 2 support buffering of requests

Hi,
I am new user to DOODs. Thanks for your work, it really helps
I am not sure whether I can post my query here.
I use two Raspberry Pis, one running image capture from IP camera and make request to another Pi which runs DOODs server.
DOODs running in docker,
My question is whether DOODs support buffer requests and process (Async) or requesting entity has to wait until receive response for request?
I couldn't solution or support about buffering requests (Async), so please guide me if it is feasible

Thanks
Karthik

Width and height missing from detector list

I'm using this to calculate the aspect ratio.

curl 127.0.0.1:8080/detectors

doods1
"detectors": [
  {
    "name": "default",
    "type": "tflite",
    "model": "models/coco_ssd_mobilenet_v1_1.0_quant.tflite",
    "labels": [],
    "width": 300,
    "height": 300,
    "channels": 3
  }
]
doods2
"detectors": [
  {
    "name": "default",
    "type": "tensorflow2",
    "model": "models/coco_ssd_mobilenet_v1_1.0_quant.tflite",
    "labels": [],
    "width": 0,
    "height": 0
  }
]

Coral USB error: Could not load EdgeTPU detector

Hi there,

I need help with my doods2 setup. I'm trying to start doods2 with my coral usb device and it's failing to create the tflite detector.

$ docker run -it -p 7070:8080 --privileged --device /dev/bus/usb -v /path_example/doods2/config.yaml:/opt/doods/config.yaml -v /path_example/doods2/
models:/opt/doods/models snowzach/doods2:latest
2022-07-18 00:37:58,763 - doods.doods - ERROR - Could not create detector tflite/default: Could not load EdgeTPU detector
2022-07-18 00:37:59,030 - uvicorn.error - INFO - Started server process [1]
2022-07-18 00:37:59,031 - uvicorn.error - INFO - Waiting for application startup.
2022-07-18 00:37:59,033 - uvicorn.error - INFO - Application startup complete.
2022-07-18 00:37:59,034 - uvicorn.error - INFO - Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

config.yaml

server:
  host: 0.0.0.0
  port: 8080
  metrics: true
logging:
  level: all
doods:
  log: detections
  boxes:
    enabled: True
    boxColor: [0, 255, 0]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [0, 255, 0]
    fontThickness: 1
  regions:
    enabled: True
    boxColor: [255, 0, 255]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [255, 0, 255]
    fontThickness: 1
  globals:
    enabled: True
    fontScale: 1.2
    fontColor: [255, 255, 0]
    fontThickness: 1
  detectors:
    - name: default
      type: tflite
      modelFile: /opt/doods/models/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite
      labelFile: /opt/doods/models/coco_labels.txt
      hwAccel: true
$ lsusb
Bus 002 Device 011: ID 18d1:9302 Google Inc. 

I'm running on a Raspberry Pi 4B. I've tried to connect the coral device straight into the USB2.0 and USB3.0 pi slots as well as connected to a powered USB3.0 hub.

When I attach the shell of the container and check for libedgetpu.so.1.0, I can see it present.

root@2a030aef58c4:/usr/lib# ls /usr/lib/aarch64-linux-gnu/libedgetpu.so.1.0 -ltr
-rw-r--r-- 1 root root 1135880 Jul  9  2021 /usr/lib/aarch64-linux-gnu/libedgetpu.so.1.0

GET /stream?detection_request= doesn't work.

The API endpoint GET /stream?detection_request= noted in the documation doesn't work. The API instead responds to GET /stream?detect_request=. Assuming this is a typo in the documentation?

Non-Quantized Model Breaks Detector

Good evening!

Giving this a shot and running into the first clear error. Using the Yolov5-built and exported to TF-Lite model, I'm getting the following:

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 27, in detect
    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 57, in detect
    self.input_data = (np.float32(self.input_data) - input_mean) / input_std
AttributeError: 'TensorflowLite' object has no attribute 'input_data'```

Note the model is not quantized - I probably should quantize it, but I'm not sure how to actually do that yet. :-P

If I have HA hit the 'default' detector which uses a quantized TFLite model, no error.

debian docker

Docker image based on debian.

FROM python:3.10.4-slim-bullseye

# Value will be appended to .bazelrc Can be used to set no-avx.
# Example: "build --copt=-mno-avx"
ARG bazelrc=""

# Bazel options.
ARG bazel_opts="--config=release_base --config=avx_linux --config=nogcp --config=nonccl"

# Build Bazel and TensorFlow CPU.
RUN apt update && \
	apt install -y --no-install-recommends \
		bazel-bootstrap git build-essential openjdk-11-jdk zip unzip && \
	cd / && \
	git clone --branch 4.2.1 --depth 1 https://github.com/bazelbuild/bazel && \
	cd /bazel && \
	bazel build "//src:bazel" --compilation_mode=opt && \
	apt purge -y bazel-bootstrap build-essential openjdk-11-jdk zip unzip --autoremove && \
	mv /bazel/bazel-bin/src/bazel /usr/bin/ && \
	rm -r /bazel && \
	\
	cd / && \
	git clone --branch r2.8 --depth 1 https://github.com/tensorflow/tensorflow.git && \
	apt install -y --no-install-recommends python3-dev gcc g++ && \
	pip install -U pip numpy wheel packaging && \
	cd /tensorflow && \
	printf "$bazelrc" >> .bazelrc && \
	bazel build $bazel_opts tensorflow/tools/pip_package:build_pip_package && \
	mkdir /tensorflow/out && \
	./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tensorflow/out --cpu && \
	pip install /tensorflow/out/* --no-deps && \
	pip uninstall -y wheel packaging && \
	apt purge -y git python3-dev gcc g++ --autoremove && \
	rm -rf /var/lib/apt/lists/* && \
	rm /usr/bin/bazel && \
	rm -r /root/.cache && \
	rm -r /tensorflow


# Install minimum amount of TensorFlow python dependencies.
RUN pip install absl-py==1.0.0 protobuf==3.20.0 \
	wrapt==1.14.0 opt_einsum==3.3.0 gast==0.5.3 \
	astunparse==1.6.3 termcolor==1.1.0 flatbuffers==2.0

How to add a model to TensorFlow?

Greetings,

I've originally posted this on self-hosted subreddit and it was really helpful to get me started.

My youngest son has Autism Spectrum Disorder (ASD), he's 5 now. Recently he developed a habit of taking off his clothes and playing around without any clothes on! I already have a few cameras around the house, however, I was wondering if anyone knows a solution that can detect if my son is moving around the house without any clothes on so I can fire up automation and play a pre-recorded voice note on speakers in the house asking him to put on his clothes again!

So I've managed to get a live camera feed into Hom Assistant, using (https://github.com/snowzach/doods2) also was able to detect objects and persons using (tensorflow) and HA saves a snapshot for labels I want to capture, such as "person" or "people". Seems to be working just fine.

I was looking for some pre-trained models to detect nudity / NSFW and found some such as: https://github.com/minto5050/NSFW-detection. However, I couldn't manage to upload this model and run it for some reason. I've downloaded the model and labels files and placed them in the models and declared it in the config file but it isn't working.

Here is how config.yaml lookslike:


doods:
  log: detections
  boxes:
    enabled: True
    boxColor: [0, 255, 0]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [0, 255, 0]
    fontThickness: 1
  regions:
    enabled: True
    boxColor: [255, 0, 255]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [255, 0, 255]
    fontThickness: 1
  globals:
    enabled: True
    fontScale: 1.2
    fontColor: [255, 255, 0]
    fontThickness: 1
  detectors:
    - name: default
      type: tflite
      modelFile: models/coco_ssd_mobilenet_v1_1.0_quant.tflite
      labelFile: models/coco_labels0.txt

    - name: tensorflow
      type: tensorflow
      modelFile: models/faster_rcnn_inception_v2_coco_2018_01_28.pb
      labelFile: models/coco_labels1.txt

    - name: nsfws
      type: tensorflow
      modelFile: models/NSFW.tflite
      labelFile: models/dict.txt

    - name: pytorch
      type: pytorch
      modelFile: ultralytics/yolov5,yolov5s
mqtt:
  metrics: true
  broker:
    host: "mqttBroker"
    #port: 1883
    #user: "username"
    #password: "password"
  requests:
    - id: firstrequest
      detector_name: default
      preprocess: []
      separate_detections: false
      crop: false
      binary_images: false
      detect:
        "*": 50
      regions:
      - top: 0.1
        left: 0.1
        bottom: 0.9
        right: 0.9
        detect:
          "*": 50
        covers: false
      data: rtsp://192.168.2.231/ch0_0.h264 

After restarting the container, I get this in the log:

2022-05-15 16:08:19,836 - doods.doods - INFO - Registered detector type:tflite name:default
2022-05-15 16:08:21,966 - doods.doods - INFO - Registered detector type:tensorflow name:tensorflow
2022-05-15 16:08:21,967 - doods.doods - ERROR - Could not create detector tensorflow/nsfws: Error parsing message with type 'tensorflow.GraphDef'
Using cache found in /root/.cache/torch/hub/ultralytics_yolov5_master
YOLOv5 🚀 2022-5-10 torch 1.10.2+cu102 CPU

Fusing layers... 
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients
Adding AutoShape... 
2022-05-15 16:08:24,158 - doods.doods - INFO - Registered detector type:pytorch name:pytorch
2022-05-15 16:08:24,208 - uvicorn.error - INFO - Started server process [1]
2022-05-15 16:08:24,208 - uvicorn.error - INFO - Waiting for application startup.
2022-05-15 16:08:24,208 - uvicorn.error - INFO - Application startup complete.
2022-05-15 16:08:24,209 - uvicorn.error - INFO - Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
GitHub Discord Credits

Only NSFW detector is giving error.

Any thoughts on how can I make this model or any other similar model work for my purpose above?

Thanks and much appreciated.

[FR:] Make confidence-number configurable on returning Image

would like to format the Precentage that is printed on the detection image.
i dont see global options for this
i dont see local detector options for this.

for my needs i would prefer two digits, like 90% or 62%
not 90.xxxxxxxxxxxxxxx.

would be best it could be configured per DETECTOR, not globally...

for example to much digits here:
image

WebSocket /detect doesn't have any error reporting

Connection closes without a error.

main.go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"

	"github.com/gorilla/websocket"
)

const doodsPath = "127.0.0.1:8080"

func main() {
	if err := run(); err != nil {
		fmt.Println(err)
	}
}

func run() error {
	img, err := os.ReadFile("./image.png")
	if err != nil {
		return fmt.Errorf("could not read file: %w", err)
	}

	request := detectRequest{
		DetectorName: "tensorflow",
		Data:         img,
		Preprocess:   []string{"grayscale"},
		Detect:       map[string]int{"*": 0},
	}

	jsonRequest, err := json.Marshal(request)
	if err != nil {
		return fmt.Errorf("could not marshal request: %w", err)
	}

	if err := post(jsonRequest); err != nil {
		return err
	}

	fmt.Println("websocket start")
	if err := ws(jsonRequest); err != nil {
		return err
	}
	return nil
}

// Working.
func post(jsonRequest []byte) error {
	response, err := http.Post(
		"http://"+doodsPath+"/detect",
		"application/json",
		bytes.NewBuffer(jsonRequest))
	if err != nil {
		return fmt.Errorf("post error: %w", err)
	}
	defer response.Body.Close()

	var jsonResponse detectResponse
	json.NewDecoder(response.Body).Decode(&jsonResponse)

	fmt.Println(jsonResponse)

	return nil
}

// Error: could not read json response: websocket: close 1000 (normal).
func ws(jsonRequest []byte) error {
	conn, _, err := websocket.DefaultDialer.Dial("ws://"+doodsPath+"/detect", nil)
	if err != nil {
		return fmt.Errorf("could not connect to doods: %w", err)
	}
	defer conn.Close()

	if err := conn.WriteJSON(jsonRequest); err != nil {
		return fmt.Errorf("could not send request: %w", err)
	}

	var response detectResponse
	if err = conn.ReadJSON(&response); err != nil {
		return fmt.Errorf("could not read json response: %w", err)
	}
	return nil
}

type detectRequest struct {
	DetectorName string         `json:"detector_name"`
	Data         []byte         `json:"data"`
	Preprocess   []string       `json:"preprocess"`
	Detect       map[string]int `json:"detect"`
}

type detectResponse struct {
	Detections []Detection `json:"detections"`
	Error      string      `json:"error"`
}

// Detection .
type Detection struct {
	Top        float32 `json:"top"`
	Left       float32 `json:"left"`
	Bottom     float32 `json:"bottom"`
	Right      float32 `json:"right"`
	Label      string  `json:"label"`
	Confidence float32 `json:"confidence"`
}

Label filtering not working with pytorch

I switched over from doods1 to doods2 using the Home Assistant plugin. I also decided to check out pytorch.

I noticed after scanning the image though that it detected a "bench" in the image, when that isn't list of labels configured in the doods image processing configuration.

Nvidia GPU support with Intel CPU

Hello,
I am not experienced with the differences of the various docker images, however, I could get a workstation with a Nvidia Quadro K420 and an Intel Core i7 CPU.
Could I use the amd64-gpu image with this hardware to get the GPU support or is it limited to amd CPUs?
Thanks for your support in advance.

Instalation with Coral Edge USB (report with issues)

Hello,

Did the installation and ran docker image with additional » -- device /dev/bus/usb «. You have a typo in your instructions about this parameter.

Then I changed config.yaml in my container and copied model and label file for Edge Coral.

doods:
detectors:
- name: default
type: tflite
modelFile: models/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite
labelFile: models/coco_labels_0.txt
hwAccel: true

  1. http://192.168.xxx.xxx:8080/detectors shows:

{"detectors":[{"name":"default","type":"tensorflow2","model":"models/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite","labels":["person","bicycle","car","motorcycle","airplane","bus","train","truck","boat","traffic light","fire hydrant","n/a","stop sign","parking meter","bench","bird","cat","dog","horse","sheep","cow","elephant","bear","zebra","giraffe","n/a","backpack","umbrella","n/a","n/a","handbag","tie","suitcase","frisbee","skis","snowboard","sports ball","kite","baseball bat","baseball glove","skateboard","surfboard","tennis racket","bottle","n/a","wine glass","cup","fork","knife","spoon","bowl","banana","apple","sandwich","orange","broccoli","carrot","hot dog","pizza","donut","cake","chair","couch","potted plant","bed","n/a","dining table","n/a","n/a","toilet","n/a","tv","laptop","mouse","remote","keyboard","cell phone","microwave","oven","toaster","sink","refrigerator","n/a","book","clock","vase","scissors","teddy bear","hair drier","toothbrush"],"width":0,"height":0}]}

  1. Additional check upon startup of container

pi@raspberrypi:~ $ sudo docker start 6710fb8a10e2
6710fb8a10e2
pi@raspberrypi:~ $ sudo docker attach 6710fb8a10e2
/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:98: UserWarning: unable to load libtensorflow_io_plugins.so: unable to open file: li btensorflow_io_plugins.so, from paths: ['/usr/local/lib/python3.8/dist-packages/ tensorflow_io/python/ops/libtensorflow_io_plugins.so']
caused by: ["[Errno 2] The file to load file system plugin from does not exist.: '/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_ io_plugins.so'"]
warnings.warn(f"unable to load libtensorflow_io_plugins.so: {e}")
/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:104: UserWarning: file system plugins are not loaded: unable to open file: libtensor flow_io.so, from paths: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/p ython/ops/libtensorflow_io.so']
caused by: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/lib tensorflow_io.so: cannot open shared object file: No such file or directory']
warnings.warn(f"file system plugins are not loaded: {e}")
Failed to load delegate from libedgetpu.so.1.0

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)

Question: Is this container related or raspberry bullseye OS?

Object has no attribute 'input_data'

This is from a png image sent over WebSockets. I think the image is being sent, maybe there's a issue decoding it? Could you add some error handling?

doods.api - ERROR - Exception(AttributeError):("'TensorflowLite' object has no attribute 'input_data'",)

Crashes on Raspbian 10

Thanks for all your work!

I am running Doods on a Raspberry Pi 4B, running Raspbian 10, without problem. However, Doods2 crashes just after start, saying:

Fatal Python error: pyinit_main: can't initialize time
Python runtime state: core initialized
PermissionError: [Errno 1] Operation not permitted

If I start the container with this command it works:
docker --privileged run -it -p 8080:8080 snowzach/doods2:latest

So, just to let anyone else know, having that problem.

Doods2 doesnt work after update /latest

Hi everyone

Im having some trouble with Doods2 after my container has updated to latest image

Im runing Home assistant to detect person with my camera's

but its failling when its trying to connect (log file from HA):

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 96, in setup_platform doods = PyDOODS(url, auth_key, timeout) File "/usr/local/lib/python3.10/site-packages/pydoods/__init__.py", line 13, in __init__ self.get_detectors() File "/usr/local/lib/python3.10/site-packages/pydoods/__init__.py", line 21, in get_detectors response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://192.168.1.205:8080/detectors 2022-08-20 22:51:33.253 ERROR (MainThread) [homeassistant.components.image_processing] Error while setting up doods platform for image_processing

The log file shows (Log file from Doods):

`today at 10:52:40 PM Container started
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:50:48 PM await self.app(scope, receive, _send)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:50:48 PM task_group.cancel_scope.cancel()
today at 10:50:48 PM2022-08-20 22:50:48,628 - uvicorn.access - INFO - 192.168.1.125:58677 - "GET /detectors HTTP/1.1" 500
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:50:48 PM raise ExceptionGroup(exceptions)
today at 10:50:48 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:50:48 PM----------------------------
today at 10:50:48 PMTraceback (most recent call last):
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:50:48 PM response = await self.dispatch_func(request, call_next)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:50:48 PM raise e from None
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:50:48 PM response = await call_next(request)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:50:48 PM raise RuntimeError("No response returned.")
today at 10:50:48 PMRuntimeError: No response returned.
today at 10:50:48 PM----------------------------
today at 10:50:48 PMTraceback (most recent call last):
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:50:48 PM await self.app(scope, request.receive, send_stream.send)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:50:48 PM raise exc
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:50:48 PM await self.app(scope, receive, sender)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:50:48 PM await route.handle(scope, receive, send)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:50:48 PM await self.app(scope, receive, send)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:50:48 PM response = await func(request)
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:50:48 PM response_data = await serialize_response(
today at 10:50:48 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:50:48 PM raise ValidationError(errors, field.type
)
today at 10:50:48 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:50:48 PMresponse -> detectors -> 2 -> labels
today at 10:50:48 PM value is not a valid list (type=type_error.list)
today at 10:50:48 PM
today at 10:51:33 PM2022-08-20 22:51:33,222 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:51:33 PM result = await app(self.scope, self.receive, self.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:51:33 PM return await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:51:33 PM await super().call(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:51:33 PM await self.middleware_stack(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:51:33 PM await self.app(scope, receive, _send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:51:33 PM task_group.cancel_scope.cancel()
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:51:33 PM raise ExceptionGroup(exceptions)
today at 10:51:33 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:51:33 PM response = await self.dispatch_func(request, call_next)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:51:33 PM raise e from None
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:51:33 PM response = await call_next(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:51:33 PM raise RuntimeError("No response returned.")
today at 10:51:33 PMRuntimeError: No response returned.
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:51:33 PM await self.app(scope, request.receive, send_stream.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:51:33 PM raise exc
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:51:33 PM await self.app(scope, receive, sender)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:51:33 PM await route.handle(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:51:33 PM await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:51:33 PM response = await func(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:51:33 PM response_data = await serialize_response(
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:51:33 PM raise ValidationError(errors, field.type
)
today at 10:51:33 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:51:33 PMresponse -> detectors -> 2 -> labels
today at 10:51:33 PM value is not a valid list (type=type_error.list)
today at 10:51:33 PM
today at 10:51:33 PM2022-08-20 22:51:33,223 - uvicorn.access - INFO - 192.168.1.204:48516 - "GET /detectors HTTP/1.1" 500
today at 10:51:33 PM2022-08-20 22:51:33,225 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:51:33 PM result = await app(self.scope, self.receive, self.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:51:33 PM return await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:51:33 PM await super().call(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:51:33 PM await self.middleware_stack(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:51:33 PM await self.app(scope, receive, _send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:51:33 PM task_group.cancel_scope.cancel()
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:51:33 PM raise ExceptionGroup(exceptions)
today at 10:51:33 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:51:33 PM response = await self.dispatch_func(request, call_next)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:51:33 PM raise e from None
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:51:33 PM response = await call_next(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:51:33 PM2022-08-20 22:51:33,226 - uvicorn.access - INFO - 192.168.1.204:48500 - "GET /detectors HTTP/1.1" 500
today at 10:51:33 PM raise RuntimeError("No response returned.")
today at 10:51:33 PMRuntimeError: No response returned.
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:51:33 PM await self.app(scope, request.receive, send_stream.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:51:33 PM raise exc
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:51:33 PM await self.app(scope, receive, sender)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:51:33 PM await route.handle(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:51:33 PM await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:51:33 PM response = await func(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:51:33 PM response_data = await serialize_response(
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:51:33 PM raise ValidationError(errors, field.type
)
today at 10:51:33 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:51:33 PMresponse -> detectors -> 2 -> labels
today at 10:51:33 PM value is not a valid list (type=type_error.list)
today at 10:51:33 PM
today at 10:51:33 PM2022-08-20 22:51:33,227 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:51:33 PM result = await app(self.scope, self.receive, self.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:51:33 PM return await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:51:33 PM await super().call(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:51:33 PM await self.middleware_stack(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:51:33 PM await self.app(scope, receive, _send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:51:33 PM task_group.cancel_scope.cancel()
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:51:33 PM raise ExceptionGroup(exceptions)
today at 10:51:33 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:51:33 PM response = await self.dispatch_func(request, call_next)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:51:33 PM raise e from None
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:51:33 PM response = await call_next(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:51:33 PM raise RuntimeError("No response returned.")
today at 10:51:33 PMRuntimeError: No response returned.
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:51:33 PM await self.app(scope, request.receive, send_stream.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:51:33 PM2022-08-20 22:51:33,227 - uvicorn.access - INFO - 192.168.1.204:48530 - "GET /detectors HTTP/1.1" 500
today at 10:51:33 PM raise exc
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:51:33 PM await self.app(scope, receive, sender)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:51:33 PM await route.handle(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:51:33 PM await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:51:33 PM response = await func(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:51:33 PM response_data = await serialize_response(
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:51:33 PM raise ValidationError(errors, field.type
)
today at 10:51:33 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:51:33 PMresponse -> detectors -> 2 -> labels
today at 10:51:33 PM value is not a valid list (type=type_error.list)
today at 10:51:33 PM
today at 10:51:33 PM2022-08-20 22:51:33,228 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:51:33 PM result = await app(self.scope, self.receive, self.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:51:33 PM return await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:51:33 PM await super().call(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:51:33 PM await self.middleware_stack(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:51:33 PM await self.app(scope, receive, _send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:51:33 PM task_group.cancel_scope.cancel()
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:51:33 PM raise ExceptionGroup(exceptions)
today at 10:51:33 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:51:33 PM response = await self.dispatch_func(request, call_next)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:51:33 PM raise e from None
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:51:33 PM response = await call_next(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:51:33 PM raise RuntimeError("No response returned.")
today at 10:51:33 PMRuntimeError: No response returned.
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:51:33 PM await self.app(scope, request.receive, send_stream.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:51:33 PM raise exc
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:51:33 PM await self.app(scope, receive, sender)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:51:33 PM await route.handle(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:51:33 PM await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:51:33 PM response = await func(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:51:33 PM response_data = await serialize_response(
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:51:33 PM raise ValidationError(errors, field.type
)
today at 10:51:33 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:51:33 PMresponse -> detectors -> 2 -> labels
today at 10:51:33 PM value is not a valid list (type=type_error.list)
today at 10:51:33 PM
today at 10:51:33 PM2022-08-20 22:51:33,228 - uvicorn.access - INFO - 192.168.1.204:48524 - "GET /detectors HTTP/1.1" 500
today at 10:51:33 PM2022-08-20 22:51:33,230 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:51:33 PM result = await app(self.scope, self.receive, self.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:51:33 PM return await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:51:33 PM await super().call(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:51:33 PM await self.middleware_stack(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:51:33 PM await self.app(scope, receive, _send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:51:33 PM task_group.cancel_scope.cancel()
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:51:33 PM raise ExceptionGroup(exceptions)
today at 10:51:33 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:51:33 PM response = await self.dispatch_func(request, call_next)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:51:33 PM raise e from None
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:51:33 PM response = await call_next(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:51:33 PM raise RuntimeError("No response returned.")
today at 10:51:33 PMRuntimeError: No response returned.
today at 10:51:33 PM----------------------------
today at 10:51:33 PMTraceback (most recent call last):
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:51:33 PM await self.app(scope, request.receive, send_stream.send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:51:33 PM raise exc
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:51:33 PM await self.app(scope, receive, sender)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:51:33 PM await route.handle(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:51:33 PM await self.app(scope, receive, send)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:51:33 PM response = await func(request)
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:51:33 PM response_data = await serialize_response(
today at 10:51:33 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:51:33 PM raise ValidationError(errors, field.type
)
today at 10:51:33 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:51:33 PMresponse -> detectors -> 2 -> labels
today at 10:51:33 PM value is not a valid list (type=type_error.list)
today at 10:51:33 PM
today at 10:51:33 PM2022-08-20 22:51:33,230 - uvicorn.access - INFO - 192.168.1.204:48532 - "GET /detectors HTTP/1.1" 500
today at 10:52:38 PM2022-08-20 22:52:38,391 - uvicorn.error - INFO - Shutting down
today at 10:52:38 PM2022-08-20 22:52:38,492 - uvicorn.error - INFO - Waiting for application shutdown.
today at 10:52:38 PM2022-08-20 22:52:38,493 - uvicorn.error - INFO - Application shutdown complete.
today at 10:52:38 PM2022-08-20 22:52:38,493 - uvicorn.error - INFO - Finished server process [1]
today at 10:52:42 PM2022-08-20 22:52:42,692 - doods.doods - INFO - Registered detector type:tflite name:default
today at 10:52:44 PM2022-08-20 22:52:44,048 - doods.doods - INFO - Registered detector type:tensorflow name:tensorflow
today at 10:52:45 PMUsing cache found in /root/.cache/torch/hub/ultralytics_yolov5_master
today at 10:52:45 PMYOLOv5 🚀 2022-8-20 Python-3.8.10 torch-1.10.2+cu102 CPU
today at 10:52:45 PM
today at 10:52:45 PMFusing layers...
today at 10:52:45 PMYOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients
today at 10:52:45 PMAdding AutoShape...
today at 10:52:45 PM2022-08-20 22:52:45,409 - doods.doods - INFO - Registered detector type:pytorch name:pytorch
today at 10:52:45 PM2022-08-20 22:52:45,440 - uvicorn.error - INFO - Started server process [1]
today at 10:52:45 PM2022-08-20 22:52:45,440 - uvicorn.error - INFO - Waiting for application startup.
today at 10:52:45 PM2022-08-20 22:52:45,440 - uvicorn.error - INFO - Application startup complete.
today at 10:52:45 PM2022-08-20 22:52:45,441 - uvicorn.error - INFO - Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
today at 10:56:32 PM2022-08-20 22:56:32,502 - uvicorn.access - INFO - 192.168.1.194:44806 - "GET / HTTP/1.1" 304
today at 10:56:32 PM2022-08-20 22:56:32,591 - uvicorn.error - ERROR - Exception in ASGI application
today at 10:56:32 PMTraceback (most recent call last):
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
today at 10:56:32 PM result = await app(self.scope, self.receive, self.send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
today at 10:56:32 PM return await self.app(scope, receive, send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in call
today at 10:56:32 PM await super().call(scope, receive, send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in call
today at 10:56:32 PM await self.middleware_stack(scope, receive, send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in call
today at 10:56:32 PM await self.app(scope, receive, _send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
today at 10:56:32 PM task_group.cancel_scope.cancel()
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
today at 10:56:32 PM raise ExceptionGroup(exceptions)
today at 10:56:32 PManyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
today at 10:56:32 PM----------------------------
today at 10:56:32 PMTraceback (most recent call last):
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
today at 10:56:32 PM response = await self.dispatch_func(request, call_next)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
today at 10:56:32 PM raise e from None
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
today at 10:56:32 PM response = await call_next(request)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
today at 10:56:32 PM raise RuntimeError("No response returned.")
today at 10:56:32 PMRuntimeError: No response returned.
today at 10:56:32 PM----------------------------
today at 10:56:32 PMTraceback (most recent call last):
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
today at 10:56:32 PM await self.app(scope, request.receive, send_stream.send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in call
today at 10:56:32 PM raise exc
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in call
today at 10:56:32 PM await self.app(scope, receive, sender)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in call
today at 10:56:32 PM await route.handle(scope, receive, send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
today at 10:56:32 PM await self.app(scope, receive, send)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
today at 10:56:32 PM response = await func(request)
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 234, in app
today at 10:56:32 PM response_data = await serialize_response(
today at 10:56:32 PM File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
today at 10:56:32 PM raise ValidationError(errors, field.type
)
today at 10:56:32 PMpydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
today at 10:56:32 PMresponse -> detectors -> 2 -> labels
today at 10:56:32 PM value is not a valid list (type=type_error.list)
today at 10:56:32 PM
today at 10:56:32 PM2022-08-20 22:56:32,597 - uvicorn.access - INFO - 192.168.1.194:44806 - "GET /detectors HTTP/1.1" 500

Im also getting an "Internal Server Error" when i try to open:
http://192.168.1.205:8080/detectors

All my containers is runing through Traefik as you can see here: 192.168.1.194
Any idear why this is happening?

It was working fine before with traefik and my setup, so im really clueless here

Any help will be pretiatet

config.yaml not used?

I'm running doods2 on a system that cannot use docker. So I have the files downloaded and I run it using a service file as a system service.
This seems to work okay, except for the fact that I cannot seem to make the config file work.

All I really wanted to do was change to font size for the detections and the colour of the capture area box to be a little less gaudy, but so far I can't seem to get any changes to stick.

I've put the sources in /home/nicole/doods2/src/doods2 with the required libraries for it in /home/nicole/doods2/bin|include|lib|share. All python libraries live there and this works overall.

The service file that makes this works is as follows:

[Unit]
Description=DOODS2 image detection service
After=multi-user.target

[Service]
Type=simple
User=nicole
WorkingDirectory=/home/nicole/doods2/src/doods2/
ExecStart=/home/nicole/doods2/bin/python3 main.py --config=/home/nicole/doods2/src/doods2/config.yaml
Environment="PATH=/home/nicole/doods2/bin:$PATH"
Restart=always

StandardOutput=file:/var/log/doods2.log
StandardError=file:/var/log/doods2.err.log

[Install]
WantedBy=multi-user.target

Note that I added the --config flag to ExecStart, but this is the part that doesn't seem to work. No error is thrown, but no config changes are being implemented, either.

There is a mention of the config.yaml file in the readme but it specifically talks about docker, and not just as a standalone service. Is there anything I need to do in particular to get the config file to be picked up, other than the inclusion of the --config= flag?

Also, is the example structure given in the readme correct? Perhaps it doesn't use my changes because the example doesn't make sense and it reverts to the built-in defaults instead.

Error installing on armv7l-based machine

After running (latest tag returns same error):

docker run -it -p 8080:8080 snowzach/doods2:armv7l

I get:

Unable to find image 'snowzach/doods2:armv7l' locally
armv7l: Pulling from snowzach/doods2
Digest: sha256:8393763dc3067984fd9f35e71571b9fadf14b515b2577cbd0da4358fc3f5268c
Status: Downloaded newer image for snowzach/doods2:armv7l
/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:98: UserWarning: unable to load libtensorflow_io_plugins.so: unable to open file: libtensorflow_io_plugins.so, from paths: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io_plugins.so']
caused by: ["[Errno 2] The file to load file system plugin from does not exist.: '/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io_plugins.so'"]
warnings.warn(f"unable to load libtensorflow_io_plugins.so: {e}")
/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:104: UserWarning: file system plugins are not loaded: unable to open file: libtensorflow_io.so, from paths: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory']
warnings.warn(f"file system plugins are not loaded: {e}")
Traceback (most recent call last):
File "main.py", line 35, in
main()
File "main.py", line 30, in main
api.run()
File "/opt/doods/api.py", line 83, in run
uvicorn.run(self.api, host=self.config.host, port=self.config.port)
File "/usr/local/lib/python3.8/dist-packages/uvicorn/main.py", line 452, in run
server.run()
File "/usr/local/lib/python3.8/dist-packages/uvicorn/server.py", line 68, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.8/asyncio/runners.py", line 39, in run
loop = events.new_event_loop()
File "/usr/lib/python3.8/asyncio/events.py", line 758, in new_event_loop
return get_event_loop_policy().new_event_loop()
File "/usr/lib/python3.8/asyncio/events.py", line 656, in new_event_loop
return self._loop_factory()
File "/usr/lib/python3.8/asyncio/unix_events.py", line 54, in init
super().init(selector)
File "/usr/lib/python3.8/asyncio/selector_events.py", line 55, in init
super().init()
File "/usr/lib/python3.8/asyncio/base_events.py", line 397, in init
self._clock_resolution = time.get_clock_info('monotonic').resolution
PermissionError: [Errno 1] Operation not permitted
Exception ignored in: <function BaseEventLoop.del at 0x767080b8>
Traceback (most recent call last):
File "/usr/lib/python3.8/asyncio/base_events.py", line 654, in del
_warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
File "/usr/lib/python3.8/asyncio/base_events.py", line 416, in repr
f'<{self.class.name} running={self.is_running()} '
File "/usr/lib/python3.8/asyncio/base_events.py", line 1878, in get_debug
return self._debug
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_debug'
sys:1: RuntimeWarning: coroutine 'Server.serve' was never awaited

does not create multiple images

I am trying to detect cats trespassing but for some reason, it is not saving the history of images, just the latest one.
This is what I am using for config. It used so save extra images too, but it stopped doing it for the last 2 days (plenty of space on disk)
- platform: doods url: "http://192.168.1.112:8080" detector: default source: - entity_id: camera.garage_camera file_out: - "/config/www/{{ camera_entity.split('.')[1] }}_latest.jpg" - "/config/www/doods/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg" confidence: 20 scan_interval: 1 area: covers: false labels: - name: person confidence: 55 - name: car confidence: 50 - name: bird confidence: 50 - name: cat confidence: 20 - name: dog confidence: 20

Permission error

I just switched from DOODS to DOODS2. When I try to start the container I get the following error:

Fatal Python error: pyinit_main: can't initialize time
Python runtime state: core initialized
PermissionError: [Errno 1] Operation not permitted

Current thread 0xf7dc4310 (most recent call first):
<no Python frame>

I am running doods2 on a raspberry pi 4. In my understanding containers always run with root privileges. Nevertheless I tried running "sudo docker run ...", still without success.

Does anyone know how to solve this issue?

Tensorflow1 models support

First of all thank you for moving Doods to Python!!
I fully agree with you that Python is a good and well known environment for machine learning and computer vision tasks.

I’m experiencing some problems with a MobilenetV2 model that is actually derived from the model for TF1 provided by Coral Google and trained with my dataset.

It seems there is a problem in managing the output: the log reports an error on line 90 in tflite.py (omitting the full traceback):

2022-01-07 19:03:35,450 - uvicorn.access - INFO - 192.168.1.100:53992 - "POST /detect HTTP/1.1" 500
2022-01-07 19:03:35,450 - uvicorn.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 "/opt/doods/detectors/tflite.py", line 90, in detect
    if int(classes[i]) in self.labels:
ValueError: cannot convert float NaN to integer

In my opinion this could be related to the fact that my model is TF1 and not TF2, as I can normally manage the output considering the result as tensors, with code similar to this one:

def output_tensor(interpreter, i):
  """Returns output tensor view."""
  tensor = interpreter.tensor(interpreter.get_output_details()[i]['index'])()
  return np.squeeze(tensor)

def get_output(interpreter, score_threshold, image_scale=1.0): 
  """Returns list of detected objects."""
  boxes = output_tensor(interpreter, 0)
  class_ids = output_tensor(interpreter, 1)
  scores = output_tensor(interpreter, 2)
  count = int(output_tensor(interpreter, 3))   
  width, height = input_size(interpreter)
  sx, sy = width / image_scale, height / image_scale 

while I noted the code in doods2 (tflite.py) is quite different:

boxes = self.interpreter.get_tensor(self.output_details[0]['index'])[0] # Bounding box coordinates of detected objects
classes = self.interpreter.get_tensor(self.output_details[1]['index'])[0] # Class index of detected objects
scores = self.interpreter.get_tensor(self.output_details[2]['index'])[0] # Confidence of detected objects

May be some change should be done in order to accept also TF1 models in doods.
If this is the case, could you consider to accept also TF1 models in doods2 providing a special flag in configuration (e.g tf_Version: 1 or 2)?
Thanks in advance.

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

image

both label-files dont work:
image

[FR:] Facedetection models possible?

MQTT Integration

This project is exactly what I'm looking for to work on some home automation projects (Frigate is pretty heavy-weight, and I'm not looking for security video recording, just automation based on location, posture, etc.). The tools I'm using so far often support MQTT as a way to trigger events, so one way or another I'd like to pipe the results out to MQTT.

It wouldn't be too difficult to write a separate service that just connects to the /stream WS and forwards all the returned JSON to MQTT, but it would mean a separate service to launch, monitor, etc.. Alternatively, I could try to add some MQTT info to the DetectRequest (sorry if I'm getting some of these names wrong, on a phone so it's hard to tab around) so that DOODS could just optionally send the JSON itself (at the expense of having to include MQTT libraries).

This definitely falls outside the scope of "REST service", so this isn't really a feature request. I just figured before I fork and start playing around with things I would ask and see if you had any thoughts on which approach would work best since you know the DOODS code.

File not found: libtensorflow_io_plugins.so

The following error occurs on my : "Raspberry Pi 3 Model B". However, the program still runs OK.

I also have: "Raspberry Pi 4 Model B", and "Raspberry PI 3 Model B+", both do not have the error.


2022-01-25T18:20:16.818386681Z /usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:98: UserWarning: unable to load libtensorflow_io_plugins.so: unable to open file: libtensorflow_io_plugins.so, from paths: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io_plugins.so']

2022-01-25T18:20:16.818622773Z caused by: ["[Errno 2] The file to load file system plugin from does not exist.: '/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io_plugins.so'"]

2022-01-25T18:20:16.818662565Z warnings.warn(f"unable to load libtensorflow_io_plugins.so: {e}")

2022-01-25T18:20:16.818698711Z /usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/init.py:104: UserWarning: file system plugins are not loaded: unable to open file: libtensorflow_io.so, from paths: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so']

2022-01-25T18:20:16.818739804Z caused by: ['/usr/local/lib/python3.8/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory']

Using MQTT in DOODS

Hi,
I would like to know, how to use the MQTT Implementation in Doods. There is a mqtt section in the config.yaml file but no matter what I do I can't get Doods to connect to my broker.
Also I haven't found any documentation on that Subject. So do you have any suggestions what I'm doing wrong ?

Problems with detection areas and multiple image_processing pipelines

I’m facing some problems with a configuration with 2 image_processing pipelines activated with doods2, using the same detector.
The problem is related to the detection area definition: if I define a detection area for each image_processing only the first one works, while the other pipeline is stopped (no detection at all on the second image_processing pipeline).

This is my configuration (extract):

image_processing:
  - platform: doods
    scan_interval: 2
    url: !secret DOODS_url 
    timeout: 10
    detector: mydetector
    source:
      - entity_id: camera.cam_one
    file_out:
      - "/config/www/{{ camera_entity.split('.')[1] }}_latest.jpg"
    area:
      top:    0.3
      left:   0.05
      bottom: 1.0
      right:  0.95 
      
  - platform: doods
    scan_interval: 2
    url: !secret DOODS_url
    timeout: 10
    detector: mydetector
    source:
      - entity_id: camera.cam_two
    file_out:
      - "/config/www/{{ camera_entity.split('.')[1] }}_latest.jpg"
    confidence: 30
    area:
      top:    0.2
      left:   0.1
      bottom: 0.9
      right:  0.95 

    labels:
    - name: MYLABEL_1
    - name: MYLABEL_2
    - name: MYLABEL_3

May be there is an error in the configuration file... but I cannot see it.

Anyway without any area definition the two pipelines work correctly.... (i.e. DOODS2 rocks!)

Thank you for your precious help!

MQTT stop working

Hi,
doods2 works great :)
But after a few time/detections it do not send to the MQTT server.

Here my config file:

server:
  host: 0.0.0.0
  port: 8080
  metrics: true
doods:
  log: detections
  boxes:
    enabled: True
    boxColor: [0, 255, 0]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [0, 255, 0]
    fontThickness: 1
  regions:
    enabled: True
    boxColor: [255, 0, 255]
    boxThickness: 1
    fontScale: 1.2
    fontColor: [255, 0, 255]
    fontThickness: 1
  globals:
    enabled: True
    fontScale: 1.2
    fontColor: [255, 255, 0]
    fontThickness: 1
  detectors:
    - name: default
      type: tflite
      modelFile: models/coco_ssd_mobilenet_v1_1.0_quant.tflite
      labelFile: models/coco_labels0.txt
mqtt:
  metrics: true
  broker: 
    host: "xxx.xxx.xxx.xxx"
    #port: 1883
    #user: "username"
    #password: "password"
  requests:
    - id: ipcam1
      detector_name: default
      preprocess: []
      data: b64
      image: jpeg
      throttle: 2
      separate_detections: true
      crop: false
      binary_images: false
      detect:
        "person": 50
      regions:
      - top: 0
        left: 0
        bottom: 0
        right: 0
        detect:
          "person": 50
        covers: false
      data: rtsp://xxx:xxx@cam:554/11

and the docker-compose file:

version: "3.6"
services:
  doods2:
    command:
      - mqtt
    container_name: doods2
    entrypoint:
      - python3
      - main.py
    environment:
      - CONFIG_FILE=xxx.yaml
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - DEBIAN_FRONTEND=noninteractive
      - LANG=C.UTF-8
      - TF_CPP_MIN_LOG_LEVEL=3
      - TZ=Europe/Berlin
    image: snowzach/doods2:latest
    ports:
      - 8010:8080/tcp
    volumes:
      - ./xxx.yaml:/opt/doods/xxx.yaml

in the docker logs I can see the detections, so the detections are ok, only the mqtt connection is not functional.

Thanks!

Deepstack model error

Love the new rewrite! I'd been using v1 for some time and just moved over to v2 container recently. Great stuff!

The recent addition of the deepstack models does not seem to be working. I see in issue #28 after it was closed that there's a report that trying to get a deepstack model working resulted in a error. I'm getting the same error with two different .pt models

Error:

2022-03-12 21:30:35,452 - uvicorn.access - INFO - 172.17.0.1:36888 - "POST /detect HTTP/1.1" 500
2022-03-12 21:30:35,452 - uvicorn.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/middleware/base.py", line 57, in __call__
    task_group.cancel_scope.cancel()
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 574, in __aexit__
    raise exceptions[0]
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
    await self.app(scope, request.receive, send_stream.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 40, in detect
    detect_response = self.doods.detect(detect_request)
  File "/opt/doods/doods.py", line 127, in detect
    ret = detector.detect(image)
  File "/opt/doods/detectors/deepstack.py", line 45, in detect
    results = self.torch_model(image, augment=False)[0]
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/.cache/torch/hub/ultralytics_yolov5_master/models/yolo.py", line 126, in forward
    return self._forward_once(x, profile, visualize)  # single-scale inference, train
  File "/root/.cache/torch/hub/ultralytics_yolov5_master/models/yolo.py", line 149, in _forward_once
    x = m(x)  # run
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/.cache/torch/hub/ultralytics_yolov5_master/models/yolo.py", line 61, in forward
    if self.inplace:
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1177, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Detect' object has no attribute 'inplace'

Both of the models work with the deepstack service itself, and doods properly reports the labels embedded in the models

    {
      "name": "dark",
      "type": "deepstack",
      "model": "external/models/dark.pt",
      "labels": [
        "Bicycle",
        "Boat",
        "Bottle",
        "Bus",
        "Car",
        "Cat",
        "Chair",
        "Cup",
        "Dog",
        "Motorbike",
        "People",
        "Table"
      ],
      "width": 0,
      "height": 0
    },
    {
      "name": "combined",
      "type": "deepstack",
      "model": "external/models/combined.pt",
      "labels": [
        "person",
        "bicycle",
        "car",
        "motorcycle",
        "bus",
        "truck",
        "bird",
        "cat",
        "dog",
        "horse",
        "sheep",
        "cow",
        "bear",
        "deer",
        "rabbit",
        "raccoon",
        "fox",
        "coyote",
        "possum",
        "skunk",
        "squirrel",
        "pig",
        ""
      ],
      "width": 0,
      "height": 0
    }

so the models seem intact.

My config for the two models is minimal:

    - name: dark
      type: deepstack
      modelFile: external/models/dark.pt
    - name: combined
      type: deepstack
      modelFile: external/models/combined.pt

do I need more than that or is there some issue with the deepstack integration at the moment?

Docker image version

I suggest to use a version when you build Docker Images instead of build only a latest tag. This is because if something is broken in the last build there's no way to return to the old working image as there's only a tag available.

Running doods2 on a Jetson Nano 4GB

Hi,
did anyone manage to run doods2 on a Jetson Nano 4GB Board including GPU support ? I found some related Issues in the old doods repository containing an old Dockerfile. Are there any plans to natively support it?

Thanks

yolov5s doesn't appear to be present

The documentation on the github readme says that yolov5s should be one of the built in models available, but the /detectors page doesn't list it as available.

I only see two detectors available -- "name":"default" and "name":"tensorflow"

Doods2 still doesn't work after update (See latest #52)

Hey I've still got the same Problem. Using a Model which was trained on a recent yolov5 Docker Image I'm getting the following Error Messages:

2022-09-10 17:02:25,639 - uvicorn.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 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
task_group.cancel_scope.cancel()
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
raise ExceptionGroup(exceptions)
anyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
response = await self.dispatch_func(request, call_next)
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
raise e from None
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
response = await call_next(request)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
raise RuntimeError("No response returned.")
RuntimeError: No response returned.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
await self.app(scope, request.receive, send_stream.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 234, in app
response_data = await serialize_response(
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
raise ValidationError(errors, field.type
)
pydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
response -> detectors -> 0 -> labels
value is not a valid list (type=type_error.list)

I've already raised an Issue on the Yolov5 github Page ultralytics/yolov5#9360
but it seems that there is still an issue on the doods side. In the github issue we discussed a recent change in the class names.
So maybe that's the Problem ?

Websockets memory leak

It's slowly using more and more memory. It takes a few million requests before it's noticeable.
Anything I should do before restarting it?

Doods server causes RPi to freeze

From time-to-time the Doods server (running in docker) will use up all memory on my RPi, which is also running my hass server, and subsequently freeze the whole machine. Only a reboot will unfreeze it. Any suggestions on how to track memory usage of the Doods server and restart it if it uses up too much memory. Hass logs from the most recent freeze are below:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 487, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 691, in async_device_update
raise exc
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/image_processing/init.py", line 138, in async_update
await self.async_process_image(image.content)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/image_processing/init.py", line 118, in async_process_image
return await self.hass.async_add_executor_job(self.process_image, image)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/doods/image_processing.py", line 295, in process_image
response = self._doods.detect(
File "/srv/homeassistant/lib/python3.8/site-packages/pydoods/init.py", line 29, in detect
response = requests.post(
File "/srv/homeassistant/lib/python3.8/site-packages/requests/api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /detect (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x5eb0b028>: Failed to establish a new connection: [Errno 24] Too many open files'))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.