IDEA-Research / deepdataspace

The Go-To Choice for CV Data Visualization, Annotation, and Model Analysis.
https://deepdataspace.com
Apache License 2.0
221 stars 18 forks source link

I could not load the keypoint labeled in edit of the collaborate tool #110

Closed ledinhtri97 closed 11 months ago

ledinhtri97 commented 11 months ago

Hello, I already update the newest version 0.9.1 when I use the collaborate labeling function. With the keypoints labeling tool, everything is fine when labeling and saving success notify. I want to look back the editor keypoint labeling and view the list images labeled.

only the bounding box available but not the key-point saving. I also want to check extract ground truth with script bellow.

dataset = DataSet.find_one({"id": dataset_id})
    # create the image model dynamically
    ImageModel = Image(dataset_id)
    num_images = ImageModel.count_num({})
    print(f"Exporting dataset of {num_images} images: {dataset.name}")
    output_images = []
    # find all images in the dataset sorted by idx and id, and exporting them
    images = ImageModel.find_many({}, sort=[("idx", 1), ("id", 1)])
    for idx, image in enumerate(images):
        # export all fields of the image
        output = {
            "id": image.id,
            "idx": image.idx,
            "url": image.url_full_res,
            "thumbnail": image.url,
            "width": image.width,
            "height": image.height,
            "metadata": json.loads(image.metadata),
            "objects": []
        }
        for anno_obj in image.objects:
            # print(anno_obj)
            obj_data = anno_obj.to_dict(exclude=["compare_result", "matched_det_idx", "confirm_type"]) # exclude some fields
            print(obj_data["points"])
            if len(obj_data["points"]):
                output["objects"].append(obj_data)
        output_images.append(output)
        if len(output["objects"]):
            print("---", output)
        # print(f"{idx + 1}/{num_images}: exported image {image.id} of {len(output['objects'])} objects")

    output = {
        "dataset_id": dataset_id,
        "dataset_name": dataset.name,
        "images": output_images
    }

    os.makedirs(output_dir, exist_ok=True)
    with open(f"{output_dir}/{dataset.name}_{dataset_id}.json", "w", encoding="utf8") as fp:
        json.dump(output, fp, ensure_ascii=False)

but there is no object had labeled too.

cefeng06 commented 11 months ago

When reviewing exported annotation data in the dataset module, please take note of the "Display options" in the upper right corner. Make sure you have selected "keypoints" to visualize both bounding boxes and keypoints.

截屏2023-12-11 22 31 05
ledinhtri97 commented 11 months ago

@cefeng06 I did not see that options image

But the main issue I think also from it lost annotation when save data, the keypoints become to be the box instead in Edit mode image

cefeng06 commented 11 months ago

Sorry, the Collaborative Mode of annotation tool currently only supports saving bbox type. We plan to expand to other types in future releases. We recommend trying the Quick Mode in the meantime. Thank you for your feedback !

ledinhtri97 commented 11 months ago

@cefeng06 thank you for your response. I got that