Spaces:
Build error
Build error
File size: 1,798 Bytes
c939ae6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
import os, sys
p = os.path.abspath('..')
sys.path.insert(1, p)
from data_expectations import create_dataset_file, dataset_validation
import glob
with open("dataset/yolo/state.txt", "r") as f:
uid = f.read()
train_imgs = glob.glob("dataset/yolo/train/images/*")
valid_imgs = glob.glob("dataset/yolo/valid/images/*")
test_imgs = glob.glob("dataset/yolo/test/images/*")
splits = [{
"meta": "dataset/images_face_detection_train.csv",
"data": "dataset/yolo/train/images/*"
},
{
"meta": "dataset/images_face_detection_valid.csv",
"data": "dataset/yolo/valid/images/*"
},
{
"meta": "dataset/images_face_detection_test.csv",
"data": "dataset/yolo/test/images/*"
}, ]
partial_success = True
for split in splits:
imgs = glob.glob(split["data"])
create_dataset_file.create(split["meta"], imgs)
results = dataset_validation.test_ge(split["meta"])
print(results)
for result in results:
print(result["success"])
partial_success = partial_success and result["success"]
if not partial_success:
break
with open("dataset/data_valid_result.txt", "w") as f:
f.write(uid.strip() + "-" + str(partial_success) )
assert partial_success
"""
images_face_detection_train = glob.glob("dataset/yolo/train/images/*")
images_face_detection_valid = glob.glob("dataset/yolo/valid/images/*")
images_face_detection_test = glob.glob("dataset/yolo/test/images/*")
create("images_face_detection_train.csv",images_face_detection_train)
create("images_face_detection_valid.csv",images_face_detection_valid)
create("images_face_detection_test.csv",images_face_detection_test)
test_ge("images_face_detection_train.csv")
test_ge("images_face_detection_valid.csv")
test_ge("images_face_detection_test.csv")
""" |