Spaces:
Paused
Paused
alessandro trinca tornidor
commited on
Commit
·
8c11d44
1
Parent(s):
7355def
[bug] handle missing placeholder images when lisa_on_cuda is installed as dependency
Browse files
lisa_on_cuda/utils/utils.py
CHANGED
@@ -170,10 +170,15 @@ def dict_to_cuda(input_dict):
|
|
170 |
def create_placeholder_variables():
|
171 |
import cv2
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
177 |
return {
|
178 |
"no_seg_out": no_seg_out,
|
179 |
"error_happened": error_happened
|
|
|
170 |
def create_placeholder_variables():
|
171 |
import cv2
|
172 |
|
173 |
+
try:
|
174 |
+
placeholders_folder = ROOT / "resources" / "placeholders"
|
175 |
+
logging.info(f"placeholders_folder:{placeholders_folder}.")
|
176 |
+
no_seg_out = cv2.imread(str(placeholders_folder / "no_seg_out.png"))[:, :, ::-1]
|
177 |
+
error_happened = cv2.imread(str(placeholders_folder / "error_happened.png"))[:, :, ::-1]
|
178 |
+
except Exception as e:
|
179 |
+
logging.error(f"e:{e}.")
|
180 |
+
logging.error(f"ROOT:{ROOT}.")
|
181 |
+
no_seg_out = error_happened = np.zeros((100, 100, 3))
|
182 |
return {
|
183 |
"no_seg_out": no_seg_out,
|
184 |
"error_happened": error_happened
|