laurenok24
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,16 @@ import base64
|
|
25 |
template_path = 'report_template_tables.html'
|
26 |
dive_data = {}
|
27 |
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
import sys
|
32 |
import csv
|
|
|
25 |
template_path = 'report_template_tables.html'
|
26 |
dive_data = {}
|
27 |
|
28 |
+
class CPU_Unpickler(pickle.Unpickler):
|
29 |
+
def find_class(self, module, name):
|
30 |
+
if module == 'torch.storage' and name == '_load_from_bytes':
|
31 |
+
return lambda b: torch.load(io.BytesIO(b), map_location='cpu')
|
32 |
+
else: return super().find_class(module, name)
|
33 |
+
|
34 |
+
dive_data_precomputed = CPU_Unpickler(open('./segmentation_error_data.pkl', 'rb')).load()
|
35 |
+
|
36 |
+
# with open('./segmentation_error_data.pkl', 'rb') as f:
|
37 |
+
# dive_data_precomputed = pickle.load(f)
|
38 |
|
39 |
import sys
|
40 |
import csv
|