# Dataset Version をエクスポート

Roboflow からは、いつでもデータをエクスポートできます。データは、Roboflow の Web インターフェースまたは Python パッケージを使ってエクスポートできます。

データをエクスポートするには、まず Roboflow ダッシュボードで dataset version を生成します。これを行うには、プロジェクトに関連付けられた「Versions」ページに移動します。

dataset を生成したら、dataset version の横にある「Export」をクリックします:

<figure><img src="/files/3307dbbe8b0f85d108c9a70abf8d06caa381cfce" alt="" width="563"><figcaption></figcaption></figure>

データは、幅広い形式でダウンロードできます。対応している export 形式の完全な一覧は、当社の「Export」タブで確認できます。 [formats directory](https://roboflow.com/formats).

export 形式を選択した後、データを次のいずれかとしてダウンロードできます。 `.zip` ファイル、または次の形式として `curl` コマンドラインからダウンロードするためのリンク。

![デバイス上の .zip フォルダにエクスポートしています。](/files/2e9f58ae27f275fd5faec5f32f193bde531aff8f)

{% hint style="warning" %}
*その `curl` と Python コードには、あなたのアカウント固有の private key が含まれます。この key を共有しないでください!*
{% endhint %}

![「Continue」を選択した後に表示される「show download code」のウィンドウ。](/files/0deaaf0792b87d228c0baf3544071e3b155a812a)

## Notes

dataset version は、コンピュータビジョンモデルの training data として使用されるように設計されています。そのため、モデルの training 経験とパフォーマンスを向上させるために、いくつかの最適化を行っています。

### Image Compression

training の低速化を防ぐため、training 速度と、十分な model performance に必要な解像度のバランスを保つレベルで画像を圧縮しています。

元の品質の画像をダウンロードしたい場合は、dataset 内の画像をクリックして「Download Image」を選択してください。

<figure><img src="/files/32b9c581f24929680834fc0253e6e828bf40a4a0" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
また、次の API を使ってプログラムから画像にアクセスすることもできます。 [Image Details API](/developer/rest-api/manage-images/get-details-about-an-image.md)。 `image.urls.original` プロパティは、元の品質の画像へのリンクを示します。
{% endhint %}

dataset 全体の元の品質の画像をダウンロードしたい場合は、次を使って行えます。 [Image Search API](/developer/rest-api/manage-images/get-details-about-an-image.md)。以下は、そのために使用できるコードスニペットです:

```python
import os
import requests
from roboflow import Roboflow

rf = Roboflow("YOUR_ROBOFLOW_API_KEY")

project = rf.project("my-dataset-id")

records = []

for page in project.search_all(
    offset = 0,
    limit = 100,
    in_dataset = True,
    batch = False,
    fields = ["id", "name", "owner"],
):
    records.extend(page)

print(f"{len(records)} images found")

for record in records:
        base_url = "https://source.roboflow.com"
        url = f"{base_url}/{record['owner']}/{record['id']}/original.jpg"

        try:
            response = requests.get(url)
            response.raise_for_status()

            # 一時ディレクトリに保存
            save_path = os.path.join('temp_images', record['name'])
            with open(save_path, 'wb') as f:
                f.write(response.content)

            print(f"Downloaded: {record['name']}")

        except requests.exceptions.RequestException as e:
            print(f"画像のダウンロード中にエラーが発生しました: {e}")

```

### 使用可能な文字

training 中の問題の発生を防ぐため、class name は upload/import と export の両方でサニタイズされます。export 時には、次の処理を行います:

* class name は ASCII に変換されます
  * 可能な場合、文字は英字化されます（例: `ü` を `u`)
  * それ以外の場合は、ダッシュ（`-`)

{% hint style="info" %}
[class name のサニタイズは upload 中にも行われます](/roboflow/roboflow-jp/datasets/adding-data.md#class-name-sanitization)
{% endhint %}

### Python Package を使った Export

Python package を使って version の生成と dataset の export の両方を行えます。

{% content-ref url="/spaces/e5GEiPeDoFksvZv1vH3A/pages/0zziwbyAo255wXPCoF3O" %}
[Create a Dataset Version](/developer/python-sdk/create-a-dataset-version.md)
{% endcontent-ref %}


---

# 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/roboflow/roboflow-jp/datasets/dataset-versions/exporting-data.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.
