Spaces:
Runtime error
Runtime error
Nadine Rueegg
commited on
Commit
β’
3a79da3
1
Parent(s):
f92c891
...
Browse files
gradio_demo/barc_demo_v3.py
CHANGED
@@ -132,11 +132,14 @@ def run_barc_inference(input_image, bbox=None):
|
|
132 |
|
133 |
|
134 |
# Select the hardware device to use for inference.
|
135 |
-
if torch.cuda.is_available() and cfg.device=='cuda':
|
136 |
device = torch.device('cuda', torch.cuda.current_device())
|
137 |
# torch.backends.cudnn.benchmark = True
|
138 |
else:
|
139 |
-
device = torch.device('cpu')
|
|
|
|
|
|
|
140 |
|
141 |
path_model_file_complete = os.path.join(cfg.paths.ROOT_CHECKPOINT_PATH, model_file_complete)
|
142 |
|
|
|
132 |
|
133 |
|
134 |
# Select the hardware device to use for inference.
|
135 |
+
'''if torch.cuda.is_available() and cfg.device=='cuda':
|
136 |
device = torch.device('cuda', torch.cuda.current_device())
|
137 |
# torch.backends.cudnn.benchmark = True
|
138 |
else:
|
139 |
+
device = torch.device('cpu')'''
|
140 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
141 |
+
print('----------------------> device: ')
|
142 |
+
print(device)
|
143 |
|
144 |
path_model_file_complete = os.path.join(cfg.paths.ROOT_CHECKPOINT_PATH, model_file_complete)
|
145 |
|