-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunnerMac.py
60 lines (45 loc) · 1.67 KB
/
runnerMac.py
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
import sys
import pathlib
import os
from codecarbon import EmissionsTracker
import timeit
## GLIOMA Dataset
# # CLASSIFICATION
classification_path = str(pathlib.Path(__file__).parent.resolve()) + "/glioma/scripts/Classification"
sys.path.append(classification_path)
os.chdir(classification_path)
with EmissionsTracker() as tracker:
start = timeit.default_timer()
import main
main.main()
stop = timeit.default_timer()
print('Runtime: ', stop - start)
print('for vizualization, call: python "./codecarbon-viz/carbonboard.py" --filepath="' + classification_path + '/emissions.csv"')
sys.path.remove(classification_path)
sys.modules.pop('main')
## EnergyEfficiencyDataset
path = str(pathlib.Path(__file__).parent.resolve().parent.resolve().parent.resolve().parent.resolve()) + "/testEnergyEfficiencyDataset"
sys.path.append(path)
os.chdir(path)
with EmissionsTracker() as tracker:
start = timeit.default_timer()
import main
main.main()
stop = timeit.default_timer()
print('Runtime: ', stop - start)
print("for vizualization, call: python './codecarbon-viz/carbonboard.py' --filepath='" + path + "/emissions.csv'")
sys.path.remove(path)
sys.modules.pop('main')
## YOLO
yolo_path = str(pathlib.Path(__file__).parent.resolve().parent.resolve()) + "/testYOLO/yolov5"
print(yolo_path)
sys.path.append(yolo_path)
os.chdir(yolo_path)
with EmissionsTracker() as tracker:
start = timeit.default_timer()
import main
stop = timeit.default_timer()
print('Runtime: ', stop - start)
print("for vizualization, call: python './codecarbon-viz/carbonboard.py' --filepath='" + yolo_path + "/emissions.csv'")
sys.path.remove(yolo_path)
sys.modules.pop('main')