-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
717 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
noise_img,output,flag,username,timestamp | ||
C:\Users\qudwn\Desktop\prenet_web\flagged\noise_img\322f100a5a9a9da8a48e66336647bd6ae6509302\tmpoov2q1dh.jpg,C:\Users\qudwn\Desktop\prenet_web\flagged\output\771b11b68b939200ac2febaffce3f4c678885428\tmpfu7rv174.png,,,2023-10-16 22:43:42.103244 |
Binary file added
BIN
+718 KB
flagged/noise_img/322f100a5a9a9da8a48e66336647bd6ae6509302/tmpoov2q1dh.jpg
Oops, something went wrong.
Binary file added
BIN
+421 KB
flagged/output/771b11b68b939200ac2febaffce3f4c678885428/tmpfu7rv174.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import gradio as gr | ||
import torch | ||
from torch.autograd import Variable | ||
from utils import * | ||
from networks import * | ||
import cv2 | ||
from torchvision import transforms | ||
import os | ||
|
||
model = PRN_r(6, 1) | ||
|
||
model = model.cuda() | ||
model.load_state_dict(torch.load('./net_latest.pth')) | ||
iscuda = torch.cuda.is_available() | ||
|
||
data_path = './datasets/Rain100H/' | ||
file_list = [data_path+file_name for file_name in os.listdir(data_path)] | ||
|
||
|
||
def deNosing(noise_img): | ||
|
||
y = np.array(noise_img) | ||
y = cv2.resize(y, (int(500), int(500)), interpolation=cv2.INTER_CUBIC) | ||
|
||
y = normalize(np.float32(y)) | ||
y = np.expand_dims(y.transpose(2, 0, 1), 0) | ||
y = Variable(torch.Tensor(y)) | ||
|
||
if iscuda: | ||
y = y.cuda() | ||
|
||
with torch.no_grad(): | ||
if iscuda: | ||
torch.cuda.synchronize() | ||
|
||
out, _ = model(y) | ||
out = torch.clamp(out, 0., 1.) | ||
|
||
if iscuda: | ||
torch.cuda.synchronize() | ||
|
||
|
||
if iscuda: | ||
save_out = np.uint8(255 * out.data.cpu().numpy().squeeze()) #back to cpu | ||
else: | ||
save_out = np.uint8(255 * out.data.numpy().squeeze()) | ||
|
||
save_out = save_out.transpose(1, 2, 0) | ||
save_out = cv2.resize(save_out,(noise_img.width,noise_img.height),interpolation=cv2.INTER_CUBIC) | ||
return save_out | ||
|
||
demo = gr.Interface(deNosing, | ||
gr.inputs.Image(type='pil'), | ||
gr.outputs.Image(type='pil'), | ||
examples=file_list | ||
) | ||
|
||
demo.launch(debug=True, share=True) |
Binary file not shown.
Oops, something went wrong.