Spaces:
Sleeping
Sleeping
wangbaoyuan
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def inference(img):
|
|
24 |
print("No image received!")
|
25 |
return None
|
26 |
import sys
|
27 |
-
sys.argv = ['--model', '--dataroot', '
|
28 |
|
29 |
# Load options and set them up
|
30 |
opt = TestOptions().parse()
|
@@ -49,7 +49,7 @@ def inference(img):
|
|
49 |
img_tensor = img_tensor.to(torch.device("cuda" if torch.cuda.is_available() else "cpu")) # Move to GPU if available
|
50 |
|
51 |
# Prepare data for the model
|
52 |
-
data = {'A':img_tensor,'A_paths':'
|
53 |
model.set_input(data)
|
54 |
model.test()
|
55 |
|
|
|
24 |
print("No image received!")
|
25 |
return None
|
26 |
import sys
|
27 |
+
sys.argv = ['--model', '--dataroot', './data/', '--num_test', '1', '--no_dropout']
|
28 |
|
29 |
# Load options and set them up
|
30 |
opt = TestOptions().parse()
|
|
|
49 |
img_tensor = img_tensor.to(torch.device("cuda" if torch.cuda.is_available() else "cpu")) # Move to GPU if available
|
50 |
|
51 |
# Prepare data for the model
|
52 |
+
data = {'A':img_tensor,'A_paths':'./data/'}
|
53 |
model.set_input(data)
|
54 |
model.test()
|
55 |
|