> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-jp/datasets/dataset-versions/exporting-data.md).

# データセットバージョンをエクスポート

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

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

データセットを生成したら、データセットのバージョンの横にある「Export」をクリックします：

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

さまざまな形式でデータをダウンロードできます。対応しているエクスポート形式の完全な一覧は、弊社の [formats directory](https://roboflow.com/formats).

エクスポート形式を選択すると、データを `.zip` ファイルとして、または `curl` リンクとしてコマンドラインからダウンロードできます。

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

{% hint style="warning" %}
*その `curl` および Python コードには、アカウント固有の秘密鍵が含まれます。この鍵を共有しないでください！*
{% endhint %}

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

## 注意

データセットのバージョンは、コンピュータビジョンモデルの学習データとして使うよう設計されています。そのため、学習体験とモデルの性能を向上させるために、いくつかの最適化を行っています。

### 画像圧縮

学習の遅延を防ぐため、学習速度と十分なモデル性能に必要な解像度とのバランスを保つレベルで画像を圧縮しています。

元の品質の画像をダウンロードしたい場合は、データセット内の画像をクリックして「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 %}

データセット全体の元の品質の画像をダウンロードしたい場合は、 [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)} 件の画像が見つかりました")

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"ダウンロードしました: {record['name']}")

        except requests.exceptions.RequestException as e:
            print(f"画像のダウンロードエラー: {e}")

```

### 使用可能な文字

トレーニング中に問題が発生するのを防ぐため、クラス名はアップロード/インポート時とエクスポート時の両方でサニタイズします。エクスポート時には、次の処理を行います：

* クラス名は ASCII に変換されます
  * 可能な場合、文字は英字化されます（例： `ü` から `u`)
  * それ以外の場合は、ダッシュ（`-`)

{% hint style="info" %}
[クラス名のサニタイズはアップロード時にも行われます](/roboflow/roboflow-jp/datasets/adding-data.md#class-name-sanitization)
{% endhint %}

### Python パッケージでエクスポートする

Python パッケージを使ってバージョンの生成とデータセットのエクスポートの両方を行えます。

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.
