Skip to main content

Integration between V7 Darwin and Voxel51

Project description

darwin_fiftyone

Provides an integration between Voxel51 and V7 Darwin. This enables Voxel51 users to send subsets of their datasets to Darwin for annotation and review. The annotated data can then be imported back into Voxel51.

This integration is currently in beta.

Example Usage

To illustrate, let's upload all files from the zoo dataset "quickstart" into a Darwin dataset named "quickstart-example". If the dataset doesn't already exist in Darwin, it will be created.

import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart", dataset_name="quickstart-example")

#If video annotation
dataset.ensure_frames()

dataset.annotate(
    "anno_key",
    label_field="ground_truth",
    atts=["iscrowd"],
    launch_editor=True,
    backend="darwin",
    dataset_slug="quickstart-example",
    external_storage="example-darwin-storage-slug",
    base_url="https://darwin.v7labs.com/api/v2/teams",
)

Note: You will have to use the ensure_frames() method on the dataset/view if you are annotating videos. You must also ensure that the label_field begins with frames. e.g. frames.detections

After the annotations and reviews are completed in Darwin, you can fetch the updated data as follows:

dataset.load_annotations("annotation_job_key")

API

In addition to the standard arguments provided by dataset.annotate(), we also support:

  • backend=darwin, Indicates that the Darwin backend is being used.
  • atts, Specifies attribute subannotations to be added in the labelling job
  • dataset_slug, Specifies the name of the dataset to use or create on Darwin.
  • external_storage, Specifies the sluggified name of the Darwin external storage and indicates that all files should be treated as external storage

Checking Status

You can check the status of your V7 Darwin dataset by calling the check_status() method

results = dataset.load_annotation_results(anno_key)
results.check_status()

Configuration

To integrate with the Darwin backend:

  1. Install the backend:
pip install .
  1. Configure voxel51 to use it.
cat ~/.fiftyone/annotation_config.json
{
  "backends": {
    "darwin": {
      "config_cls": "darwin_fiftyone.DarwinBackendConfig",
      "api_key": "d8mLUXQ.**********************"
    }
  }
}

Note: Replace the api_key placeholder with a valid API key generated from Darwin.

Testing

Set up your environment with FiftyOne and Darwin integration settings. To find your team slug check the Darwin documentation on dataset identifiers which has a section called "Finding Team Slugs:"

You'll also need an API Key

export FIFTYONE_ANNOTATION_BACKENDS=*,darwin
export FIFTYONE_DARWIN_CONFIG_CLS=darwin_fiftyone.DarwinBackendConfig
export FIFTYONE_DARWIN_API_KEY=******.*********
export FIFTYONE_DARWIN_TEAM_SLUG=your-team-slug-here

Testing external storage

In order to test the integration with external cloud media storage, you will need to configure an external storage with the relevant media files available.

The tests make use of the quickstart and quickstart-video datasets. The following code will download the local images and videos that you need to upload to a cloud bucket:

import fiftyone.zoo as foz

image_dataset = foz.load_zoo_dataset("quickstart", max_samples=3)
print(image_dataset.values("filepath"))

video_dataset = foz.load_zoo_dataset("quickstart-video", max_samples=2)
print(video_dataset.values("filepath"))

You also need to export the following environment variables for your cloud bucket which contains the above files and external storage name that you configured in darwin:

export FIFTYONE_DARWIN_TEST_BUCKET="provider://path/to/bucket" # ex: "gs://test-bucket"
export FIFTYONE_DARWIN_TEST_EXTERNAL_STORAGE="darwin-external-storage-name"

Supported Annotation Types

The integration currently supports bounding boxes, polygons (closed polylines), keypoints, and tags (classification). It also supports attributes, text, instance ids, and properties subtypes.

Future development work will focus on the addition of annotation and subannotation types. Do reach out if you have suggestions.

TODO

  • Support for read only external data storage
  • Support for mask and keypoint skeleton types

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darwin_fiftyone-1.1.20.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

darwin_fiftyone-1.1.20-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file darwin_fiftyone-1.1.20.tar.gz.

File metadata

  • Download URL: darwin_fiftyone-1.1.20.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for darwin_fiftyone-1.1.20.tar.gz
Algorithm Hash digest
SHA256 9a5b82f9b765faccbec40bfc368c87a8e93d05048cf134f23b1890bd53bc662b
MD5 c2523e1ab8b4793f65cb73a1d45fdbcf
BLAKE2b-256 adab5ebea59c2fcb723260031f39651b69af7ba1735223ba4b83b5e986fad4d1

See more details on using hashes here.

File details

Details for the file darwin_fiftyone-1.1.20-py3-none-any.whl.

File metadata

File hashes

Hashes for darwin_fiftyone-1.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 1f9ca7a336f94e21203c58bf97f3d42800949bc5c92103a08ffc97cba7be432c
MD5 61d6c55485c57c2a22ca04a9749dcca0
BLAKE2b-256 8d0be759c52fc24bdd715ecf799c8f310f8965a440afe94db1dead0990ca1e78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page