Roboflow Docs
DashboardResourcesProducts
  • Documentation
  • Developer Reference
  • Changelog
  • Developer Tools
  • Authentication
  • Command Line Interface (CLI)
    • Using the CLI
    • Installation and Authentication
    • Download dataset
    • Upload Dataset
    • Run inference
    • Getting help
  • REST API
    • REST API Structure
    • Workspace and Project IDs
    • Workspaces
  • Workspace Image Query
  • Projects
    • Initialize
    • Project Folders API
    • Create
  • Batches
  • Annotation Jobs
  • Images
    • Upload Images
    • Image Details
    • Upload Dataset
    • Upload an Annotation
    • Search
    • Tags
  • Versions
    • Create a Project Version
    • View a Version
  • Train a Model
  • Export Data
  • Inference
  • Annotation Insights
    • Annotation Insights (Legacy Endpoint)
  • Model Monitoring
    • Stats
    • Custom Metadata
  • Python SDK
    • Using the Python SDK
  • iOS SDK
    • Using the iOS SDK
Powered by GitBook
On this page

Was this helpful?

  1. Images

Upload Dataset

You can upload a full dataset to Roboflow using the Python SDK and CLI.

The upload_dataset method lets you upload a dataset to a workspace into a new project or to one that already exists within Roboflow.

To upload a dataset using the Python SDK, use the following code:

import roboflow

rf = roboflow.Roboflow(api_key=YOUR_API_KEY_HERE)

# get a workspace
workspace = rf.workspace("WORKSPACE_URL")

# Upload data set to a new/existing project
workspace.upload_dataset(
    "./dataset/", # This is your dataset path
    "PROJECT_ID", # This will either create or get a dataset with the given ID
    num_workers=10,
    project_license="MIT",
    project_type="object-detection",
    batch_name=None,
    num_retries=0
)

The num_workers value allows you to set how many images should be uploaded concurrently. We recommend setting a value no greater than 25.

You can import an entire dataset from your local file system using the import subcommand. This is a way to import your pre-existing datasets or any dataset from Roboflow Universe into your Roboflow Projects.

Let’s say you download a dataset from Roboflow Universe in the COCO format. Unzip the dataset you downloaded from Roboflow Universe, and then import the project into one of your own projects by pointing the roboflow import command at the folder:

roboflow import ./Aerial\ Maritime.v24i.coco/

This will understand most common computer vision dataset formats and assign train/valid/test splits and annotation metadata to the images being uploaded.

Learn more details about this CLI command in the relevant section of our CLI docs.

PreviousImage DetailsNextUpload an Annotation

Was this helpful?