Examples

Conservator-CLI includes a number of scripts, in the examples folder of the Conservator-CLI github repository, that demonstrate the functionality of the APIs it provides. Some of the scripts provided are merely code samples, while others can be run interactively. Each of the scripts includes comments that describe what the code does. The examples/upload_videos folder includes a script that can be used to upload video data and metadata in bulk, which is described here.

  • clone_dataset.py:

    This script contains brief examples of how to clone a dataset programmatically.

  • create_dataset_annotation_custom_metadata.py:

    A runnable script that demonstrates how to add custom metadata to a dataset annotation.

  • create_dataset_frames.py:

    A runnable script that will add local JPG images as frames to a dataset.

  • create_video_annotation_custom_metadata.py:

    A runnable script that demonstrates how to add custom metadata to a video or image annotation.

  • dataset_annotation_qa.py:

    A runnable script that demonstrates how to perform QA operations on a dataset annotation.

  • download_associated_files.py:

    This script contains brief examples of how to download associated files for projects/folders, datasets, and images.

  • download_videos.py:

    This script provides sample code for downloading multiple videos in parallel.

  • list_dataset_frames.py:

    This script provides sample code for listing the frames of a dataset.

  • list_projects.py:

    This script provides sample code for listing all projects.

  • paginate_video_frames.py:

    This script provides sample code for paginating video frames.

  • populate_dataset.py:

    This script provides sample code for populating dataset fields.

  • query_by_exact_name.py:

    This script provides sample code for searching projects by exact name.

  • recursively_list_project_media.py:

    This script provides sample code for recursively listing all media (i.e. videos and images) in a project.

  • search_datasets.py:

    This script provides some brief examples of using search functionality.

  • search_videos_in_collection.py:

    This script shows how to search for videos within a project or folder.

  • upload_associated_file.py:

    This script provides sample code for uploading associated files to projects/folders, datasets, and images.

  • upload_many_videos.py:

    This script demonstrates how to upload multiple videos to a folder in parallel.

  • upload_metadata.py:

    This script demonstrates how to upload metadata for a dataset or an image.

  • video_annotation_qa.py:

    A runnable script that demonstrates how to perform QA operations on a video annotation.

  • dataset_frame_annotation_qa_from_json.py:

    Apply a set of dataset frame annotation changes and QA settings from an input JSON file.