Anthony Miyaguchi
commited on
Commit
•
411c19f
1
Parent(s):
df2ac53
Update metadata file
Browse files- README.md +7 -1
- SnakeCLEF2024-TestMetadata.csv +0 -0
- evaluate/data.py +1 -1
- evaluate/test_evaluate.py +1 -1
README.md
CHANGED
@@ -2,4 +2,10 @@
|
|
2 |
license: mit
|
3 |
---
|
4 |
|
5 |
-
Repository: https://github.com/dsgt-kaggle-clef/snakeclef-2024/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: mit
|
3 |
---
|
4 |
|
5 |
+
Repository: https://github.com/dsgt-kaggle-clef/snakeclef-2024/
|
6 |
+
|
7 |
+
To run the tests:
|
8 |
+
|
9 |
+
```bash
|
10 |
+
pytest evaluate -vv -x
|
11 |
+
```
|
SnakeCLEF2024-TestMetadata.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
evaluate/data.py
CHANGED
@@ -36,7 +36,7 @@ class ImageDataset(Dataset):
|
|
36 |
|
37 |
def __getitem__(self, idx):
|
38 |
row = self.metadata.iloc[idx]
|
39 |
-
image_path = Path(self.images_root_path) / row.
|
40 |
img = Image.open(image_path).convert("RGB")
|
41 |
img = v2.ToTensor()(img)
|
42 |
return {"features": img, "observation_id": row.observation_id}
|
|
|
36 |
|
37 |
def __getitem__(self, idx):
|
38 |
row = self.metadata.iloc[idx]
|
39 |
+
image_path = Path(self.images_root_path) / row.filename
|
40 |
img = Image.open(image_path).convert("RGB")
|
41 |
img = v2.ToTensor()(img)
|
42 |
return {"features": img, "observation_id": row.observation_id}
|
evaluate/test_evaluate.py
CHANGED
@@ -34,7 +34,7 @@ def images_root(tmp_path):
|
|
34 |
def metadata(tmp_path, images_root):
|
35 |
res = []
|
36 |
for i, img in enumerate(images_root.glob("*.jpg")):
|
37 |
-
res.append({"
|
38 |
df = pd.DataFrame(res)
|
39 |
df.to_csv(tmp_path / "metadata.csv", index=False)
|
40 |
return tmp_path / "metadata.csv"
|
|
|
34 |
def metadata(tmp_path, images_root):
|
35 |
res = []
|
36 |
for i, img in enumerate(images_root.glob("*.jpg")):
|
37 |
+
res.append({"filename": img.name, "observation_id": i})
|
38 |
df = pd.DataFrame(res)
|
39 |
df.to_csv(tmp_path / "metadata.csv", index=False)
|
40 |
return tmp_path / "metadata.csv"
|