import keyring | |
from roboflow import Roboflow | |
# Retrieve the API key securely from the keyring | |
api_key = keyring.get_password('roboflow', 'api_key') | |
if not api_key: | |
raise ValueError(""" | |
API key not found in keyring. | |
Make sure it is stored securely. | |
Usage: | |
pip install keyring | |
python -c \"import keyring; keyring.set_password('roboflow', 'api_key', 'your_actual_api_key')\" | |
""") | |
rf = Roboflow(api_key=api_key) | |
project = rf.workspace("okinawaaibeachrobot").project("beach-cleaning-object-detection") | |
version = project.version(1) | |
dataset = version.download("coco", "./data") | |