Skip to content

Commit

Permalink
update upload script
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Mar 21, 2024
1 parent f70b7e2 commit d925fd0
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions scripts/upload_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
yaml = YAML(typ="safe")
logger = logging.getLogger(__name__)

# COLLECTION_URL = "https://raw.githubusercontent.com/bioimage-io/collection-bioimage-io/gh-pages/collection.json"
COLLECTION_URL = "https://raw.githubusercontent.com/bioimage-io/collection-bioimage-io/bd814413906ad105e8732a50b51a954aae25771b/collection.json"
COLLECTION_SHA256 = "44d3bdc9120139f864a76da8669c7ad8d77fd4c09b66fb4319db826326691614"
UPLOAD_URL = "https://oc.embl.de/index.php/s/mdE3in0099rQFwW"

COLLECTION_FOLDER = (
Path(__file__).parent.parent.parent / "collection-bioimage-io/collection"
)
Expand Down Expand Up @@ -122,19 +117,6 @@ def upload_resources(
print(f"uploaded {upload_count}")


def get_model_urls_from_collection_json():
collection_path = Path(pooch.retrieve(COLLECTION_URL, known_hash=COLLECTION_SHA256)) # type: ignore

with collection_path.open() as f:
collection = json.load(f)

return [
entry["rdf_source"]
for entry in collection["collection"]
if entry["type"] == "model"
]


def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999):
assert COLLECTION_FOLDER.exists()
ret: List[Tuple[BioimageioYamlContent, RootHttpUrl]] = []
Expand Down Expand Up @@ -201,7 +183,7 @@ def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999):
return ret


UPLOADED = {
UPLOADED_SANDBOX = {
"funny-butterfly_v1.zip",
"committed-turkey_v1.zip",
"pioneering-goat_v1.zip",
Expand Down Expand Up @@ -256,7 +238,8 @@ def get_model_urls_from_collection_folder(start: int = 0, end: int = 9999):
"determined-hedgehog_v1.zip",
}

UPLOADED = {}

if __name__ == "__main__":
# model_urls = get_model_urls_from_collection_json()
model_urls = get_model_urls_from_collection_folder(start=0)
upload_resources(model_urls)

0 comments on commit d925fd0

Please sign in to comment.