Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
juansensio committed Aug 21, 2024
1 parent 0804bda commit 11cb8cd
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 3,923 deletions.
16 changes: 8 additions & 8 deletions eotdl/eotdl/datasets/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def ingest_folder(
readme = frontmatter.load(folder.joinpath("README.md"))
metadata, content = readme.metadata, readme.content
metadata = Metadata(**metadata)
except FileNotFoundError:
# load metadata (legacy)
metadata = (
yaml.safe_load(open(folder.joinpath("metadata.yml"), "r").read()) or {}
)
metadata = Metadata(**metadata)
content = None
# except FileNotFoundError:
# # load metadata (legacy)
# metadata = (
# yaml.safe_load(open(folder.joinpath("metadata.yml"), "r").read()) or {}
# )
# metadata = Metadata(**metadata)
# content = None
except Exception as e:
# print(str(e))
print(str(e))
raise Exception("Error loading metadata")
# retrieve dataset (create if doesn't exist)
dataset = retrieve_dataset(metadata, user)
Expand Down
2 changes: 2 additions & 0 deletions eotdl/eotdl/datasets/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def source_is_url(cls, v):
# validate thumbnail is a url
@validator("thumbnail")
def thumbnail_is_url(cls, v):
if not v:
return ""
if not v.startswith("http") and not v.startswith("https"):
raise ValueError("thumbnail must be a URL")
return v
Expand Down
19 changes: 10 additions & 9 deletions tutorials/notebooks/05_q2_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{
"data": {
"text/plain": [
"'2024.05.02'"
"'2024.08.05'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -135,7 +135,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -156,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -217,7 +217,7 @@
"<Link rel=child target=<Collection id=model>>"
]
},
"execution_count": 15,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -252,7 +252,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -313,7 +313,7 @@
"<Link rel=item target=<Item id=model>>"
]
},
"execution_count": 16,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -366,9 +366,10 @@
"\t\t\t\"name\": \"road binary mask\",\n",
"\t\t\t\"tasks\": [\"segmentation\"], # redundant ?\n",
"\t\t\t\"result\": { # https://github.com/crim-ca/mlm-extension?tab=readme-ov-file#result-structure-object\n",
"\t\t\t\t\"shape\": [-1, -1, -1],\n",
"\t\t\t\t\"shape\": [-1, 1, -1, -1],\n",
"\t\t\t\t\"dim_order\": [\n",
"\t\t\t\t\t\"batch\",\n",
"\t\t\t\t\t\"channel\",\n",
"\t\t\t\t\t\"height\",\n",
"\t\t\t\t\t\"width\"\n",
"\t\t\t\t],\n",
Expand Down Expand Up @@ -398,7 +399,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -420,7 +421,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 11cb8cd

Please sign in to comment.