cvat: can not get attributes with detector model

My actions before raising this issue

  • Read/searched the docs
  • Searched past issues

Expected Behaviour

I defined label as

[
  {
    "name": "text",
    "id": 1,
    "color": "#20cc1c",
    "attributes": [
      {
        "id": 1,
        "name": "word",
        "input_type": "text",
        "mutable": false,
        "values": [
          ""
        ]
      }
    ]
  }
]

I deployed a text detector with ocr ml model to annotation data, model runs fine, but only polygons was displayed, the attributes was blank.

Current Behaviour

image

[
    {
        "confidence": null,
        "label": "text",
        "points": [
            28,
            19,
            103,
            19,
            103,
            44,
            28,
            44
        ],
        "type": "polygon",
        "attributes": [
            {
                "id": 1,
                "name": "word",
                "input_type": "text",
                "mutable": false,
                "values": "ocr result text"
            }
        ]
    }
    ...

Possible Solution

Steps to Reproduce (for bugs)

  1. text-detector-0004 add attributes to result
  2. modify model_handler.py add return attributes code
for box in pcd.bboxes:
            results.append({
                "confidence": None,
                "label": self.labels.get(obj_class, "unknown"),
                "points": box.ravel().tolist(),
                "type": "polygon",
                # add attributes for test
                "attributes":
                    [
                        {
                            "id": 1,
                            "name": "word",
                            "input_type": "text",
                            "mutable": False,
                            "values": "ocr result text"
                        }
                    ]
                })
  1. deploy text-detector
  2. annotation with text-detector-0004

Context

Your Environment

  • Git hash commit (git log -1):
$ git log -1
commit 8d03ed7959632d6f3ffd76020ad577fa409acfcd
Merge: 56c9626 476b2fc
Author: Nikita Manovich <nikita.manovich@intel.com>
Date:   Fri Sep 17 14:22:09 2021 +0300

    Merge branch 'release-1.6.0'
  • Docker version docker version (e.g. Docker 17.0.05):
$ docker version
Client: Docker Engine - Community
 Version:           20.10.10
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        b485636
 Built:             Mon Oct 25 07:44:50 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.10
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       e2f740d
  Built:            Mon Oct 25 07:43:13 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.11
  GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
  • Are you using Docker Swarm or Kubernetes? No
  • Operating System and version (e.g. Linux, Windows, MacOS):
$ uname -a
Linux ai-research 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Code example or link to GitHub repo or gist to reproduce problem:
  • Other diagnostic information / logs:
    Logs from `cvat` container

Next steps

You may join our Gitter channel for community support.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I found the reason, function.yaml must has attributes describe

metadata:
  name: openvino-omz-intel-text-detection-0004
  namespace: cvat
  annotations:
    name: Text detection v4
    type: detector
    framework: openvino
    spec: |
      [
        { "id": 1, "name": "text",  "attributes": [
          {
            "name": "word",
            "input_type": "text"

          }]
        }
      ]

now it can work correctly, thanks!