Spaces:
Runtime error
Runtime error
IanNathaniel
commited on
Commit
•
f27615d
1
Parent(s):
f55aa35
Update app.py
Browse files
app.py
CHANGED
@@ -20,19 +20,17 @@ import time
|
|
20 |
def lowlight(image):
|
21 |
os.environ['CUDA_VISIBLE_DEVICES']=''
|
22 |
data_lowlight = Image.open(image)
|
23 |
-
|
|
|
24 |
|
25 |
-
|
26 |
data_lowlight = (np.asarray(data_lowlight)/255.0)
|
27 |
-
|
28 |
-
|
29 |
data_lowlight = torch.from_numpy(data_lowlight).float()
|
30 |
data_lowlight = data_lowlight.permute(2,0,1)
|
31 |
data_lowlight = data_lowlight.cpu().unsqueeze(0)
|
32 |
|
33 |
DCE_net = model.enhance_net_nopool().cpu()
|
34 |
DCE_net.load_state_dict(torch.load('Epoch99.pth', map_location=torch.device('cpu')))
|
35 |
-
|
36 |
_,enhanced_image,_ = DCE_net(data_lowlight)
|
37 |
|
38 |
torchvision.utils.save_image(enhanced_image, f'01.png')
|
|
|
20 |
def lowlight(image):
|
21 |
os.environ['CUDA_VISIBLE_DEVICES']=''
|
22 |
data_lowlight = Image.open(image)
|
23 |
+
|
24 |
+
start = time.time()
|
25 |
|
|
|
26 |
data_lowlight = (np.asarray(data_lowlight)/255.0)
|
|
|
|
|
27 |
data_lowlight = torch.from_numpy(data_lowlight).float()
|
28 |
data_lowlight = data_lowlight.permute(2,0,1)
|
29 |
data_lowlight = data_lowlight.cpu().unsqueeze(0)
|
30 |
|
31 |
DCE_net = model.enhance_net_nopool().cpu()
|
32 |
DCE_net.load_state_dict(torch.load('Epoch99.pth', map_location=torch.device('cpu')))
|
33 |
+
|
34 |
_,enhanced_image,_ = DCE_net(data_lowlight)
|
35 |
|
36 |
torchvision.utils.save_image(enhanced_image, f'01.png')
|