Update data.yaml
Browse files
data.yaml
CHANGED
|
@@ -1,6 +1,25 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
val: pyro-sdis/images/val # Path to validation images
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datasets import load_dataset
|
| 2 |
+
import pandas as pd
|
|
|
|
| 3 |
|
| 4 |
+
ds = load_dataset("pyronear/pyro-sdis")
|
| 5 |
+
|
| 6 |
+
rows = []
|
| 7 |
+
|
| 8 |
+
for split in ds:
|
| 9 |
+
for x in ds[split]:
|
| 10 |
+
rows.append({
|
| 11 |
+
"split": split,
|
| 12 |
+
"image_name": x["image_name"],
|
| 13 |
+
"partner": x["partner"],
|
| 14 |
+
"camera": x["camera"],
|
| 15 |
+
"date": x["date"],
|
| 16 |
+
"annotations": x["annotations"],
|
| 17 |
+
"has_smoke": bool(x["annotations"].strip())
|
| 18 |
+
})
|
| 19 |
+
|
| 20 |
+
df = pd.DataFrame(rows)
|
| 21 |
+
df.to_csv("pyro_sdis.csv", index=False)
|
| 22 |
+
|
| 23 |
+
print("Tổng ảnh:", len(df))
|
| 24 |
+
print("Ảnh có nhãn khói:", df["has_smoke"].sum())
|
| 25 |
+
print("Ảnh annotation rỗng:", (~df["has_smoke"]).sum())
|