Skip to content

Latest commit

 

History

History
239 lines (189 loc) · 18.3 KB

File metadata and controls

239 lines (189 loc) · 18.3 KB

Survey-of-Intelligent-algorithms-for-unusual-weather-in-Internet-of-Things

1.The derain algorithms we used in paper

Algorithms Paper Link Projects Link
DDN Paper Link Code Link
DerainNet Paper Link Code Link
LPNet Paper Link Code Link
PReNet Paper Link Code Link
GP-based SSL Paper Link Code Link

Testing execution time

$T_{total} = T_{load \ model} + n * ( T_{read} + T_{process} + T_{write} )$ , where $n$ is testing image amount.

How to divide execution time (code)

When you test the following algorithms, please modify the testing_data_path and save_path like here. 👇

ground_data_path: /home/ubuntu/code/datasets/test/$dataset_name$/ground_truth

testing_data_path: /home/ubuntu/code/datasets/test/$dataset_name$/rainy_image

save_path: /home/ubuntu/code/results/$dataset_name$/$algorithm_name$

$dataset_name$ includes Rain100H , Rain100L , Rain12 , and Rain1400.

You had better save every csv file in each corresponding save_path.

How to write data to a csv file in Python?
 
import csv

# Configure headers

headers = ['image', 'read_time', 'process_time', 'write_time']
rows = []

# Process loop...

item = {"image":img_name,"read_time":read_dur_time, "process_time":process_dur_time, "write_time": write_dur_time }
rows.append(item)

# Final statistics
rows.append({"image": "average" , "read_time":avg_read_time, "process_time":avg_process_time, "write_time": avg_write_time})
rows.append({"image": "load_model_time", "read_time" : load_model_time})
rows.append({"image": "total_time", "read_time" : total_time})

# Output to a csv file

with open( opt.save_path +'/time_result.csv','w') as f:
		f_csv = csv.DictWriter(f, headers)
		f_csv.writeheader()
		f_csv.writerows(rows)

  </blockcode></pre>
How to write data to a csv file in MATLAB?
 
- **How to write data to a `csv` file in MATLAB**?


%%%%%%%%%%%%%%%%%%%%%%
% Test code for the paper:
% X. Fu, J. Huang, D. Zeng, Y. Huang, X. Ding and J. Paisley. "Removing Rain from Single Images via a Deep Detail Network", CVPR, 2017
%
% NOTE: The MatConvNet toolbox has been installed with CUDA 7.5 and 64-bit windows 10
% You may need to re-install MatConvNet for your own computer configuration: http://www.vlfeat.org/matconvnet/
% This code is for demo only and the result can be slightly different from the paper due to transferring across platforms
%%%%%%%%%%%%%%%%%%%%%%
clc;
clear;
t0=clock;
process_time=[];
total_write_time=[];
total_read_time=[];
file_path1= 'F:\BaiduNetdiskDownload\datasets\Rain1400\rainy_image\';
img_path_list1 = dir(strcat(file_path1,'*.jpg'));
img_num = length(img_path_list1);
I = cell(img_num,1);
OutputDir = 'C:\Users\admin\Desktop\CVPR17\CVPR17\result\Rain1400\';
addpath 'fast-guided-filter-code-v1'
%run('matconvnet\matlab\vl_setupnn')
t3=clock;
run '.\matconvnet\matlab\vl_setupnn'
load('network.mat'); % load trained model
t4=clock;
load_model_time=etime(t4,t3);
disp(['load_model_time is ', num2str(load_model_time) ])
use_gpu = 1; % GPU: 1, CPU: 0
%%% parameters of guidedfilter
r = 16;
eps = 1;
s = 4;
%%%
if img_num > 0
for j = 1:img_num
read_start_time=clock;
image_name1 = img_path_list1(j).name;
%disp('deraining...')
I{j}=image_name1;
input_photo = imread(strcat(file_path1,image_name1));
read_end_time=clock;
read_dur_time=etime(read_end_time,read_start_time);
total_read_time=[total_read_time,eval(num2str(read_dur_time))];
process_start_time =clock;
input = im2double(input_photo);
base_layer = zeros(size(input)); % base layer
base_layer(:, :, 1) = fastguidedfilter(input(:, :, 1), input(:, :, 1), r, eps, s);
base_layer(:, :, 2) = fastguidedfilter(input(:, :, 2), input(:, :, 2), r, eps, s);
base_layer(:, :, 3) = fastguidedfilter(input(:, :, 3), input(:, :, 3), r, eps, s);
detail_layer = input - base_layer; % detail layer
output = processing( input, detail_layer, model, use_gpu ); % perform de-raining
process_end_time =clock;
process_dur_time = etime(process_end_time,process_start_time);
process_time=[process_time,eval(num2str(process_dur_time))];
disp([erase(image_name1,'.jpg'), '_result.jpg', ' image process time is ', num2str(process_dur_time) ])
write_start_time =clock;
imwrite(output,[OutputDir, erase(image_name1,'.jpg'), '_result.jpg']);
%disp('derain completed')
write_end_time = clock;
write_dur_time = etime(write_end_time,write_start_time);
total_write_time=[total_write_time,eval(num2str(write_dur_time))];
end
end
columns = {'imagename', 'read_time', 'process_time','write_time'};
total_read_time=total_read_time';
process_time=process_time';
total_write_time=total_write_time';
data = table(I, total_read_time, process_time,total_write_time,'VariableNames',columns);
writetable(data, 'Rain1400.csv')
disp(['total_time:',num2str(etime(clock,t0))]);

2. Detection Code and Model

Algorithms Code Link Pretrain Model Link
Faster-RCNN Code Link sh./data/scripts/fetch_faster_rcnn_models.sh
RetinaNet Code Link MSCOCO pretrain model
YoloV3 Code Link https://pjreddie.com/media/files/yolov3.weights
SSD-512 Code Link https://drive.google.com/file/d/0BzKzrI_SkD1_NVVNdWdYNEh1WTA/view

3. Synthetic Data and Real Data

Data Type Download Link Download Link
Rain Mist Real Access Code: 6h55 Synthetic Access Code: 8kae
Rain Drop Real Access Code: n6xf Synthetic Access Code : wscw
Rain Streak Real Access Code: npsy Synthetic Access Code: drxn
the dataset of Deep-Network Github
Rain100H, Rain100L, Rain1400 and Rain12 Onedrive
Rain12600, RainTrainL, RainTrainH Onedrive

*We note that:

RainTrainL/Rain100L and RainTrainH/Rain100H are synthesized by Yang Wenhan.

  • RainTrainH has 1800 rainy images for training, and Rain100H has 100 rainy images for testing. Rain12600/Rain1400 is from Fu Xueyang and Rain12 is from Li Yu.*
  • Rain12600 and Rain1400 contains 1,000 clean images. Each clean image was used to generate 14 rainy images with different streak orientations and magnitudes.Rain12600 has 900 clean images for "training" and Rain1400 has 100 clean images for "testing".
  • Rain12 only includes 12 rainy images

4. Image Quality Metrics

In the paper we design and combine the full-reference and no-feference metrics in python file and matlab file,each of them will output the data to a csv file,and we have upload them in the github.

5. Some related algorithms and Paper Link

The rain models

  • Automatic single-image-based rain streaks removal via image decomposition (TIP2012), Kang et al [PDF] [Code]

  • Removing rain from a single image via discriminative sparse coding [PDF]

  • Depth-attentional Features for Single-image Rain Removal [PDF]

  • Frame-Consistent Recurrent Video Deraining with Dual-Level Flow [PDF]

model-driven

  • Guided image filtering (ECCV2010), He et al. [Project] [PDF] [Code]

  • Removing rain and snow in a single image using guided filter (CSAE2012), Xu et al. [PDF]

  • An improved guidance image based method to remove rain and snow in a single image (CIS2012), Xu et al. [PDF]

  • Single-image deraining using an adaptive nonlocal means filter (ICIP2013), Kim et al. [PDF]

  • Single-image-based rain and snow removal using multi-guided filter (NIPS2013), Zheng et al. [PDF]

  • Single image rain and snow removal via guided L0 smoothing filter (Multimedia Tools and Application2016), Ding et al. [PDF]

  • Automatic single-image-based rain streaks removal via image decomposition (TIP2012), Kang et al [PDF] [Code]

  • Self-learning-based rain streak removal for image/video (ISCS2012), Kang et al. [PDF]

  • Single-frame-based rain removal via image decomposition (ICA2013), Fu et al. [PDF]

  • Exploiting image structural similarity for single image rain removal (ICIP2014), Sun et al. [PDF]

  • Visual depth guided color image rain streaks removal using sparse coding (TCSVT2014), Chen et al [PDF]

  • Removing rain from a single image via discriminative sparse coding (ICCV2015), Luo et al [PDF] [Code]

  • Rain streak removal using layer priors (CVPR2016), Li et al [PDF] [Code]

  • Single image rain streak decomposition using layer priors (TIP2017), Li et al [PDF]

  • Error-optimized dparse representation for single image rain removal (IEEE TIE2017), Chen et al [PDF]

  • A hierarchical approach for rain or snow removing in a single color image (TIP2017), Wang et al. [PDF]

  • Joint bi-layer optimization for single-image rain streak removal (ICCV2017), Zhu et al. [PDF]

  • Convolutional sparse and low-rank codingbased rain streak removal (WCACV2017), Zhang et al [PDF]

  • Joint convolutional analysis and synthesis sparse representation for single image layer separation (CVPR2017), Gu et al [PDF] [Code]

  • Single image deraining via decorrelating the rain streaks and background scene in gradient domain (PR2018), Du et al [PDF]

data-driven

  • Restoring an image taken through a window covered with dirt or rain (ICCV2013), Eigen et al. [Project] [PDF] [Code]
  • Attentive generative adversarial network for raindrop removal from a single image (CVPR2018), Qian et al [Project] [PDF]
  • Clearing the skies: A deep network architecture for single-image rain streaks removal (TIP2017), Fu et al. [Project] [PDF] [Code]
  • Removing rain from single images via a deep detail network (CVPR2017), Fu et al. [Project] [PDF] [Code]
  • Image de-raining using a conditional generative adversarial network (Arxiv2017), Zhang et al [PDF] [Code]
  • Deep joint rain detection and removal from a single image (CVPR2017), Yang et al.[Project] [PDF] [Code]
  • Residual guide feature fusion network for single image deraining (ACMMM2018), Fan et al. [Project] [PDF]
  • Fast single image rain removal via a deep decomposition-composition network (Arxiv2018), Li et al [Project]) [PDF] [Code]
  • Density-aware single image de-raining using a multi-stream dense network (CVPR2018), Zhang et al [PDF] [Code]
  • Recurrent squeeze-and-excitation context aggregation net for single image deraining (ECCV2018), Li et al. [PDF] [Code]
  • Rain streak removal for single image via kernel guided cnn (Arxiv2018), Wang et al [PDF]
  • Physics-based generative adversarial models for image restoration and beyond (Arxiv2018), Pan et al [PDF]
  • Learning dual convolutional neural networks for low-level vision (CVPR2018), Pan et al [Project] [PDF] [Code]
  • Non-locally enhanced encoder-decoder network for single image de-raining (ACMMM2018), Li et al [PDF] [Code]
  • Unsupervised single image deraining with self-supervised constraints (ICIP2019), Jin et al [PDF]
  • Progressive image deraining networks: A better and simpler baseline (CVPR2019), Ren et al [PDF] [Code]
  • Spatial attentive single-image deraining with a high quality real rain dataset (CVPR2019), Wang et al [Project] [PDF] [Code]
  • Lightweight pyramid networks for image deraining (TNNLS2019), Fu et al [PDF] [Code]
  • Joint rain detection and removal from a single image with contextualized deep networks (TPAMI2019), Yang et al [PDF] [Code]