Roboflow Docs
DashboardResourcesProducts
  • Product Documentation
  • Developer Reference
  • Changelog
  • Developer Tools
  • Authentication
    • Find Your Roboflow API Key
    • Scoped API Keys
    • Workspace and Project IDs
  • Command Line Interface (CLI)
    • Using the CLI
    • Install and Set Up the CLI
    • List Workspaces and Projects
    • Download a Dataset
    • Upload a Dataset
    • Run a Model on an Image
  • REST API
    • Using the REST API
    • Authenticate with the REST API
    • List Workspaces and Projects
  • Search Images in a Dataset
  • Create a Project
  • Get a Project and List Versions
  • Manage Project Folders
  • List Image Batches
  • Create and List Annotation Jobs
  • Manage Images
    • Upload an Image
    • Get Details About an Image
    • Delete an Image from a Dataset
    • Upload an Annotation
    • Search for an Image
    • List, Add, and Remove Image Tags
  • Versions
    • View a Version
  • Export Data
  • Annotation Insights
    • Annotation Insights (Legacy Endpoint)
  • Model Monitoring
    • Retrieve Statistics About Deployed Models in a Workspace
    • Attach Metadata to an Inference
  • Python SDK
    • Using the Python SDK
  • Authenticate with the Python SDK
  • List Workspaces
  • List Projects and Versions
  • Create a Project
  • Create a Dataset Version
  • Train a Model
  • Upload a Dataset
  • Search for an Image
  • iOS SDK
    • Using the iOS SDK
Powered by GitBook
On this page

Was this helpful?

Create a Dataset Version

To create a Dataset version, use the project.generate_version() method.

import roboflow

rf = roboflow.Roboflow(api_key=YOUR_API_KEY_HERE)

project = rf.workspace().project("PROJECT_ID")

project.generate_version(settings={
    "augmentation": {},
    "preprocessing": {},
})

Here is a full example of the settings. There is a detailed explanation for each property below.

{
    "augmentation": {
        "bbblur": { "pixels": 1.5 },
        "bbbrightness": { "brighten": true, "darken": false, "percent": 91 },
        "bbcrop": { "min": 12, "max": 71 },
        "bbexposure": { "percent": 30 },
        "bbflip": { "horizontal": true, "vertical": false },
        "bbnoise": { "percent": 50 },
        "bbninety": { "clockwise": true, "counter-clockwise": false, "upside-down": false },
        "bbrotate": { "degrees": 45 },
        "bbshear": { "horizontal": 45, "vertical": 45 },
        "blur": { "pixels": 1.5 },
        "brightness": { "brighten": true, "darken": false, "percent": 91 },
        "crop": { "min": 12, "max": 71 },
        "cutout": { "count": 26, "percent": 71 },
        "exposure": { "percent": 30 },
        "flip": { "horizontal": true, "vertical": false },
        "hue": { "degrees": 180 },
        "image": { "versions": 32 },
        "mosaic": true,
        "ninety": { "clockwise": true, "counter-clockwise": false, "upside-down": false },
        "noise": { "percent": 50 },
        "rgrayscale": { "percent": 50 },
        "rotate": { "degrees": 45 },
        "saturation": { "percent": 50 },
        "shear": { "horizontal": 45, "vertical": 45 }
    },
    "preprocessing": {
        "auto-orient": true,
        "contrast": { "type": "Contrast Stretching" },
        "filter-null": { "percent": 50 },
        "filter-tags": { "tag_name": true, "other_tag": false },
        "grayscale": true,
        "isolate": true,
        "remap": { "original_class_name": "new_class_name" },
        "resize": { "width": 200, "height": 200, "format": "Stretch to" },
        "static-crop": { "x_min": 10, "x_max": 90, "y_min": 10, "y_max": 90 },
        "tile": { "rows": 2, "columns": 2 }
    }
}
PreviousCreate a ProjectNextTrain a Model

Last updated 12 hours ago

Was this helpful?