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
11.74k stars 2.88k forks source link

can't access property "length", e is undefined #8086

Closed VeyDlin closed 3 days ago

VeyDlin commented 3 days ago

Actions before raising this issue

Steps to Reproduce

No response

Expected Behavior

No response

Possible Solution

No response

Context

I am trying to create a clothing segmentation module based on U2NET. It works well, but it seems that the frontend is not processing the response correctly.

I used the SAM example and based my module on it - https://github.com/VeyDlin/cvat-clothing-segmentation.

However, I continue to receive an error when trying to create the mask.

Interaction error occurred can't access property "length", e is undefined

Environment

No response

bsekachev commented 3 days ago

Unfortunately we can't help with issues in custom code

VeyDlin commented 2 days ago

The api documentation would be enough for me, what is expected from the function?

bsekachev commented 2 days ago

In case with SAM nuclio only performs image encoding and returns binary blob with image embeddings. These embeddings with user input (mask clicks) are decoded on client using onnx javascript module. You may find decoder code here: cvat-ui/plugins/sam.

In case with other interactors, client expects the following structure:

export interface InteractorResults {
    mask: number[][];
    points?: [number, number][];
    bounds?: [number, number, number, number]
}