Giter Club home page Giter Club logo

pysolotools's Introduction

The open-source tool for loading and analyzing Unity SOLO datasets

PyPI version License

Introduction

pysolotools is a python package for managing SOLO datasets. It helps to perform following tasks:

  • Parse SOLO datasets generated with Unity Perception
  • Dataset iterables
  • Convert SOLO to COCO format
  • Compute common statistics

You can read more about SOLO schema here.

Pre-Requisites

Installation

pip install pysolotools --index-url=https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple

SOLO Dataset

Load and iterate frames
from pysolotools.consumers import Solo
solo = Solo(data_path="src_data_path")

for frame in solo.frames():
    # perform operations on frame
SOLO2COCO conversion

Supports conversion for these labels: 2d bbox, keypoints, instance, semantic.

from pysolotools.converters.solo2coco import SOLO2COCOConverter
from pysolotools.consumers import Solo

solo = Solo("src_data_path")
dataset = SOLO2COCOConverter(solo)
dataset.convert(output_path="output_path")
Stats computation

Supports bbox, keypoints and image analysis on SOLO dataset.

from pysolotools.consumers import Solo
from pysolotools.stats.analyzers.bbox_analyzer import BBoxHeatMapStatsAnalyzer, BBoxSizeStatsAnalyzer
from pysolotools.stats.handler import StatsHandler

bbheat=BBoxHeatMapStatsAnalyzer()
bbsize=BBoxSizeStatsAnalyzer()
solo = Solo("data_path")
bbh= StatsHandler(solo=solo)
bbh.handle(analyzers=[bbheat,bbsize],cat_ids=[])

Community and Feedback

The Unity Computer Vision demos are open-source and we encourage and welcome contributions. If you wish to contribute, be sure to review our contribution guidelines and code of conduct.

Support

For feature requests, bugs, or other issues, please file a GitHub issue using the provided templates we will investigate as soon as possible.

License

Apache License 2.0

pysolotools's People

Contributors

86sanj avatar deshpandeshrinath avatar fsudrew07 avatar jonathanhunity avatar luca-unity avatar mkamalza avatar ruiyuz avatar sanjayvishwak avatar saurav-d avatar sladebot avatar snyk-bot avatar soumaliroychowdhury avatar stevenborkman 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

Watchers

 avatar  avatar  avatar  avatar  avatar

pysolotools's Issues

Is PySoloTools suitable for transforming the Multiview SOLO Dataset into COCO Dataset format?

In the solo2coco.py script, there is a specific method def _process_instances(...) that solely utilizes the first item within the list, and evidently, this is the limiting factor impeding the conversion process of the multi-camera SOLO Dataset.

@staticmethod
    def _process_instances(
        frame: Frame, idx, output, data_root, solo_kp_map
    ) -> Tuple[Dict, List, List, List]:
        logger.info(f"Processing Frame number: {idx}")
        image_id = idx
        sequence_num = frame.sequence
        rgb_capture = list(
            filter(lambda cap: isinstance(cap, RGBCameraCapture), frame.captures)
        )[0]

        img_record = SOLO2COCOConverter._process_rgb_image(
            image_id, rgb_capture, output, data_root, sequence_num
        )
        (
            ann_record,
            ins_ann_record,
            sem_ann_record,
        ) = SOLO2COCOConverter._process_annotations(
            image_id, rgb_capture, sequence_num, data_root, solo_kp_map
        )

        return img_record, ann_record, ins_ann_record, sem_ann_record

Are there existing methods within PySoloTools to convert a SOLO Dataset with multiple cameras into the COCO format collectively?

KeyError: 'value' thrown on converting solo to coco dataset

I tried converting a solo dataset to coco dataset. Note that the dataset had only segmentations and keypoints but no bounding boxes.

from pysolotools.converters import SOLO2COCOConverter
converter = SOLO2COCOConverter(solo)
converter.convert(output_path="path/to/output/directory", dataset_name="coco")


I am getting the following error:

` 156 if not field.init:
157 continue
--> 159 field_value = kvs[field.name]
160 field_type = types[field.name]
161 if field_value is None and not _is_optional(field_type):
KeyError: 'values'

If full error message is required, I can post it again here.

It's actually coming from solo.frames().

Adding support for keypoint names/labels other than the ones used in the COCO dataset

Hi,

I am working with a SOLO dataset where the keypoint labels are not the ones used in the COCO dataset. I would however like to convert this SOLO dataset to the COCO format. In the Keypoint Detection part of the COCO format documentation, it is explained how other keypoint names should be handled.

I would be interested in making a PR to add support for custom keypoint names. I would like to know if such a PR would be welcome, and, if yes, if there is anything I should know before starting to implement it.

(The current behavior is to simply ignore all the keypoints whose name is not in the COCO dataset, essentially failing silently.)

SOLO2COCOConverter throws keyerror "instances" when no labeled objects in image

Hi,

Due to the settings used in my dataset generation, apparently not all images have a visible object (around 1/1000 images don't have 2D bounding boxes).
This causes the SOLO2COCOConverter to crash with a keyerror "instances" error.

Perhaps the converter can be updated to just skip images if there is no label, rather than crash? As I don't know which images don't have any bounding boxes, I now have to write a separate script which deletes these instances this before feeding the data to the converter.

Error on protobuf when installing on Mac

I have got this error when trying to install the visualizer on Mac (the same error does not appear on windows), not sure what is causing this error, it seems to point to unity_vision.

ERROR: Could not find a version that satisfies the requirement protobuf==3.17.2 (from unity-vision) (from versions: none)
ERROR: No matching distribution found for protobuf==3.17.2

Converting instance segmentation SOLO to COCO - IndexError

Hey,
I created a synthetic dataset using unity perception labelled only with instance segmentation,
When i was trying to convert it to COCO format i received an error of list index out of range:

Screenshot from 2022-12-08 13-16-55

Tried to dig in the code and figure it out by myself, had no success there.
Anyone as a clue why is it happening ?
When i tried to modify the code i received different errors because i couldnt recreate the data wanted by myself in this parameter.

Screenshot from 2022-12-08 13-20-24

Tnx in advance,
Mark

Test-Runner uses different UCVD API Client than Pysolotools

The Integration Test we have for Antojito/Pozole operations is using a standalone UCVD API Client to make calls.

pysolotools exists and also has nearly identical functionality. This issue is to replace the UCVD API Client used in this repo with the one from pysolotools.

pysolotools should also trigger this integration test. You can see an example of that demonstrated here.

Is pysolotool doesn't support conversion of pose labels to COCO format?

After assigning pose labels for keypoint labeler I can see the annotation and labels in SOLO format. But after converting to COCO format any information related to pose labels and Metadata Reporter Label is missing.

Steps:

  • Assign bounding box 2D, keypointLabeler and MetadataReporterLabeler on perception camera
  • Assign pose config for any animation in keypointLabeler array
  • create data using that animation on any humanoid model
  • In SOLO format all of the above labels will be visible
  • Convert this SOLO data to COCO (Issue: There will be error if you don't add box2DLabeler)
  • In COCO format you can only see bbox labels and key point labels. All other labels will be missing.

Error: An attempt has been made to start a new process before current process has finished

Hey,

I wanted to test your tool, so I followed the README.
I must say I did pip install pysolotools without --index-url=https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple because it wasn't working with it. But it worked anyway

When trying to run this code I got an error.

from pysolotools.converters.solo2coco import SOLO2COCOConverter
from pysolotools.consumers import Solo

solo = Solo("src_data_path")
dataset = SOLO2COCOConverter(solo)
dataset.convert(output_path="output_path")

This error kept repeating itself.

image

Any help on how to use your tool would be appreciated

Pysolotools Serialization Issue

Got another pysolotools serialization issue. Details can be found here in the logs.

KeyError: 'captures'

Generated dataset is here: gs://unity-ai-antojito-prd-dataset-files-0819/7520a09c-9447-469d-b074-ebe8705b39a1/attempt:0

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.