cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.48k stars 2.99k forks source link

How to get a rotated rectangle from serverless api? #6891

Closed WilliamKyle closed 1 year ago

WilliamKyle commented 1 year ago

here is the raw output of rectangle from https://github.com/opencv/cvat/blob/develop/serverless/onnx/WongKinYiu/yolov7/nuclio/model_handler.py

 results.append({
                        "confidence": str(score),
                        "label": self.labels.get(label, "unknown"),
                        "points": [xtl, ytl, xbr, ybr],
                        "type": "rectangle",
                    })

I try to add rotation and it's not work

 results.append({
                        "confidence": str(score),
                        "label": self.labels.get(label, "unknown"),
                        "points": [xtl, ytl, xbr, ybr],
                        "type": "rectangle",
                        "rotation": "30",
                    })

I try to add rotation in attributes and it's also not work

 results.append({
                        "confidence": str(score),
                        "label": self.labels.get(label, "unknown"),
                        "points": [xtl, ytl, xbr, ybr],
                        "type": "rectangle",
                        "attributes": [
                            {"name": "rotation", "value": "30"},
                        ],
                    })

how can I get a rotated rectangle ?

zhiltsov-max commented 1 year ago

Hi, you will probably need to modify the server code to enable support for this. Please check the module source code here.