์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

Ultralytics HUB-SDK๋ฅผ ์‚ฌ์šฉํ•œ ๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ด€๋ฆฌ ์ž‘์—…

Ultralytics HUB-SDK ๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ด€๋ฆฌ ๋ฌธ์„œ์— ์˜ค์‹  ๊ฒƒ์„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค! ๐Ÿ‘‹

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ๋จธ์‹  ๋Ÿฌ๋‹์˜ ์„ธ๊ณ„์—์„œ ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ์ˆ™๋ จ๋œ ๋ฐ์ดํ„ฐ ๊ณผํ•™์ž๋“  ์ด ๋ถ„์•ผ์˜ ์ดˆ๋ณด์ž๋“ , ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ์ž‘์—…์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๋ฉด ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๊ฐ„์†Œํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŽ˜์ด์ง€์—์„œ๋Š” Python ์˜ Ultralytics HUB-SDK๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ธฐ๋ณธ ์‚ฌํ•ญ์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. ์ œ๊ณต๋œ ์˜ˆ์ œ์—์„œ๋Š” ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ๊ฐ€์ ธ์˜ค๊ธฐ, ๋งŒ๋“ค๊ธฐ, ์—…๋ฐ์ดํŠธ, ์‚ญ์ œ, ๋‚˜์—ดํ•˜๊ธฐ, ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ์•ก์„ธ์Šค๋ฅผ ์œ„ํ•œ URL ๊ฐ€์ ธ์˜ค๊ธฐ ๋ฐ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ์—…๋กœ๋“œ ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

์ž์„ธํžˆ ์•Œ์•„๋ด…์‹œ๋‹ค! ๐Ÿš€

ID๋กœ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ๊ฐ€์ ธ์˜ค๊ธฐ

ํŠน์ • ๋ฐ์ดํ„ฐ์„ธํŠธ๋ฅผ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”? ์•„๋ž˜ ์ฝ”๋“œ ์Šค๋‹ˆํŽซ๊ณผ ํ•จ๊ป˜ ๊ณ ์œ  ID๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น ๋ฅด๊ฒŒ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฅผ ํฌํ•จํ•œ ํ•„์ˆ˜ ์ •๋ณด์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Fetch a dataset by ID
dataset = client.dataset("<Dataset ID>")  # Replace with your actual Dataset ID
print(dataset.data)  # This prints the dataset information

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ๋งŒ๋“ค๊ธฐ

์ƒˆ ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•  ์ค€๋น„๊ฐ€ ๋˜์…จ๋‚˜์š”? ์•„๋ž˜ ๋‹จ๊ณ„์— ๋”ฐ๋ผ ์ƒˆ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ๋งŒ๋“œ์„ธ์š”. ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์˜ ์ด๋ฆ„์„ ์นœ์ˆ™ํ•œ ์ด๋ฆ„์œผ๋กœ ์ •์˜ํ•˜๊ณ  create_dataset ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Define your dataset properties
data = {"meta": {"name": "My Dataset"}}  # Replace 'My Dataset' with your desired dataset name

# Create the dataset
dataset = client.dataset()
dataset.create_dataset(data)
print("Dataset created successfully!")

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ์—…๋ฐ์ดํŠธ

ํ”„๋กœ์ ํŠธ๊ฐ€ ๋ฐœ์ „ํ•จ์— ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์„ธํŠธ๋„ ๋ฐœ์ „ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ, ์ƒˆ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์Œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Obtain the dataset
dataset = client.dataset("<Dataset ID>")  # Insert the correct Dataset ID

# Update the dataset's metadata
dataset.update({"meta": {"name": "Updated Name"}})  # Modify 'Updated Name' as required
print("Dataset updated with new information.")

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ์‚ญ์ œ

์ž‘์—… ๊ณต๊ฐ„์„ ์ •๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ๋˜๋Š” ๋” ์ด์ƒ ํ•„์š”ํ•˜์ง€ ์•Š์•„์„œ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ์ œ๊ฑฐํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ, ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ์˜๊ตฌ์ ์œผ๋กœ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. delete ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Select the dataset by its ID
dataset = client.dataset("<Dataset ID>")  # Ensure the Dataset ID is specified

# Delete the dataset
dataset.delete()
print("Dataset has been deleted.")

๋ฐ์ดํ„ฐ ์„ธํŠธ ๋‚˜์—ด

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ํƒ์ƒ‰ํ•˜๊ฑฐ๋‚˜ ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ์ฐพ์œผ๋ ค๋ฉด ํŽ˜์ด์ง€ ๋งค๊น€์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋“  ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ๋‚˜์—ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŽ์€ ์ˆ˜์˜ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ๋‹ค๋ฃฐ ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Retrieve the first page of datasets
dataset = client.dataset_list(page_size=10)
print("Current dataset:", dataset.results)  # Show the datasets on the current page

# Move to the next page and show results
dataset.next()
print("Next page result:", dataset.results)

# Go back to the previous page
dataset.previous()
print("Previous page result:", dataset.results)

์ €์žฅ์†Œ์—์„œ URL ๊ฐ€์ ธ์˜ค๊ธฐ

์ด ํŽธ๋ฆฌํ•œ ๊ธฐ๋Šฅ์€ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์ €์žฅ์†Œ ์•ก์„ธ์Šค๋ฅผ ์œ„ํ•œ URL์„ ๊ฐ€์ ธ์˜ค๊ธฐ ๋•Œ๋ฌธ์— ์›๊ฒฉ์œผ๋กœ ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ ์„ธํŠธ ํŒŒ์ผ์ด๋‚˜ ์•„ํ‹ฐํŒฉํŠธ๋ฅผ ์‰ฝ๊ฒŒ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Define the dataset ID for which you want a download link
dataset = client.dataset("<Dataset ID>")  # Don't forget to replace Dataset ID with the actual dataset ID

# Retrieve the URL for downloading dataset contents
url = dataset.get_download_link()
print("Download URL:", url)

๋ฐ์ดํ„ฐ ์„ธํŠธ ์—…๋กœ๋“œ

๋ฐ์ดํ„ฐ ์„ธํŠธ ์—…๋กœ๋“œ๋Š” ๊ฐ„๋‹จํ•œ ๊ณผ์ •์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ID์™€ ์—…๋กœ๋“œํ•˜๋ ค๋Š” ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•œ ๋‹ค์Œ, ์—…๋กœ๋“œํ•˜๋ ค๋Š” ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ upload_dataset ํ•จ์ˆ˜๋Š” ์•„๋ž˜์—์„œ ์ž์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

from hub_sdk import HUBClient

credentials = {"api_key": "<YOUR-API-KEY>"}
client = HUBClient(credentials)

# Select the dataset
dataset = client.dataset("<Dataset ID>")  # Substitute with the real dataset ID

# Upload the dataset file
dataset.upload_dataset(file="<Dataset File>")  # Make sure to specify the correct file path
print("Dataset has been uploaded.")

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์œผ๋กœ ์ž‘์—…ํ•  ๋•Œ๋Š” ํ•ญ์ƒ ํ”„๋กœ์„ธ์Šค์˜ ๊ฐ ๋‹จ๊ณ„๋ฅผ ํ™•์ธํ•˜๊ณ  ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด ์ข‹์€ ์Šต๊ด€์ด๋ผ๋Š” ์ ์„ ๊ธฐ์–ตํ•˜์„ธ์š”. ๋ฐ์ดํ„ฐ ์„ธํŠธ ID์™€ ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ๋‹ค์‹œ ํ•œ ๋ฒˆ ํ™•์ธํ•˜์—ฌ ๋ชจ๋“  ๊ฒƒ์ด ์›ํ™œํ•˜๊ฒŒ ์‹คํ–‰๋˜๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.

๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฑฐ๋‚˜ ๊ถ๊ธˆํ•œ ์ ์ด ์žˆ์œผ๋ฉด ์นœ์ ˆํ•œ ์ง€์›ํŒ€์—์„œ ๋„์™€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ๐Ÿค

ํ–‰๋ณตํ•œ ๋ฐ์ดํ„ฐ ๋žญ๊ธ€๋ง์„ ํ†ตํ•ด ์ •ํ™•ํ•˜๊ณ  ์ธ์‚ฌ์ดํŠธ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ๋Š” ๋ชจ๋ธ์ด ๋˜๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค! ๐ŸŒŸ


๋Œ“๊ธ€