データセットバージョンをエクスポートする
トレーニング用に Roboflow からデータをエクスポートします。



注意
画像圧縮

許容される文字
Pythonパッケージでのエクスポート
Create a Dataset VersionLast updated
Was this helpful?
トレーニング用に Roboflow からデータをエクスポートします。




Last updated
Was this helpful?
Was this helpful?
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 to temp directory
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"Error downloading image: {e}")