Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
•
cd1bbe4
1
Parent(s):
d48129a
add write_data
Browse filesSigned-off-by: Niv Sardi <xaiki@evilgiggle.com>
- python/write_data.py +17 -0
python/write_data.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import csv
|
2 |
+
import entity
|
3 |
+
from common import defaults
|
4 |
+
|
5 |
+
def gen_data_yaml(bcos):
|
6 |
+
names = [f"{d.name}" for d in bcos.values()]
|
7 |
+
return f'''
|
8 |
+
train: ../data/squares
|
9 |
+
val: ../data/squares
|
10 |
+
|
11 |
+
nc: {len(bcos.keys())}
|
12 |
+
names: [{names}]
|
13 |
+
'''
|
14 |
+
|
15 |
+
if __name__ == '__main__':
|
16 |
+
bcos = entity.read_entities(defaults.MAIN_CSV_PATH)
|
17 |
+
print(gen_data_yaml(bcos))
|