# Create a Dataset Version

A version freezes a snapshot of the project's labeled data with a chosen set of preprocessing and augmentation steps applied. Train against a version, not against the project directly.

`Project.generate_version()` returns the new version number, which you can pass to `project.version(...)` to get a `Version` handle.

```python
import roboflow

rf = roboflow.Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace().project("my-detector")

new_version = project.generate_version(settings={
    "preprocessing": {
        "auto-orient": True,
        "resize": {"width": 640, "height": 640, "format": "Stretch to"},
    },
    "augmentation": {},
})
version = project.version(new_version)
```

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

```json
{
    "versionName": "Raccoons",
    "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 }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/developer/python-sdk/create-a-dataset-version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
