Quickstart Guide

This guide will help you quickly incorporate your OcularAI dataset exports into your Vision-Language Model (VLM) training workflow.

Prerequisites

  • Python 3.7+
  • A valid OcularAI API key
  • Access to at least one workspace on the OcularAI platform

Step 1: Navigate to OcularAI Foundry

To get started, navigate to the OcularAI Foundry platform, select the required version to incorporate in your work environment.

main version page to show user how to create a export from a version

Step 2: Create an Export

Click on the create export button and navigate to the previous exports tab to select the required export.

create export page to show user how he can create a export

You’ll get a customized snippet that you can use to download the dataset.

Step 3: Get Your API Key

Configure your API key from OcularAI Foundry platform by navigating to:

Workspace settings / developers console / API keys

API keys page to show , how to create a api key

Step 4: Install the SDK

Install the OcularAI SDK using pip:

pip install ocular-ai

Step 5: Download Your Dataset

Here’s a simple example of how to download a dataset using the SDK:

from ocular import Ocular

# Initialize the SDK with your API key
ocu = Ocular(api_key="YOUR_API_KEY")

# Access your workspace and project
project = ocu.workspace("WORKSPACE_ID").project("PROJECT_ID")

# Get a specific version
version = project.version("VERSION_ID")

# Get an export and download the dataset
export = version.export("EXPORT_ID")
dataset = export.download()

# The dataset variable contains the path to the downloaded dataset
print(f"Dataset downloaded to: {dataset}")

You can find the specific IDs for your workspace, project, version, and export in the OcularAI Foundry platform.

Alternative: Using Direct Download

If you prefer, you can also use cURL to download your dataset directly:

curl -L "https://api.useocular.com/api/v1/versions/{version_id}/exports/{export_id}" \
     -o export.zip && \
     unzip export.zip && \
     rm export.zip

Replace {version_id} and {export_id} with your specific IDs.

Store your API key in environment variables to avoid hardcoding it in your scripts. The SDK will automatically look for the OCULAR_API_KEY environment variable.