本文主要是介绍CycleISP环境配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
配置
环境:AutoDL GPU服务器
https://github.com/swz30/CycleISP
git clone https://github.com/swz30/CycleISP.git
sudo apt-get install cmake build-essential libjpeg-dev libpng-dev
pip install matplotlib scikit-image yacs lycon natsort h5py tqdm
pip install opencv-python opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple
问题:
*.Ubuntu ModuleNotFoundError: No module named 'skimage.measure.simple_metrics'
--->pip install scikit-image==0.16.2
python debug:cannot import name ‘compare_psnr‘& cannot import name ‘compare_ssim‘_呆呆象呆呆的博客-CSDN博客
*.Ubuntu python generate_rgb_data.py报错
--->
*.Win10 numpy报错:Original error was: DLL load failed: 找不到指定的模块。
--->pip install --upgrade numpy(或者卸载重新安装)
*.Win10 lycon安装报错
--->cv2替换lycon操作
*.Win10 加载数据使用多线程报错
--->
代码+原理
*.torch实现高斯核
二维高斯核公式如下:
C语言实现便于理解,可以debug打印直观的看下高斯核
/*************************************************************
*Function: Gauss mask compute
*Params:
* r-radius of gauss filter
* sigma-sigma of gauss filter
* gaussMask-gauss weight to compute with size of (2r+1)*(2r+1)
*Return NULL
************************************************************/
void GaussMask(int r, double sigma, double gaussMask[])
{double PI = 3.1415926;double sum = 0;int stride = 2 * r + 1;for (int y = -r, h = 0; y <= r; y++, h++){for (int x = -r, w = 0; x <= r; x++, w++){gaussMask[w + h * stride] = (1.0 / (2.0 * PI * sigma * sigma)) * (exp(-((double)x * (double)x + (double)y * (double)y) / (2.0 * sigma * sigma)));sum += gaussMask[w + h * stride];}}for (int i = 0; i < stride * stride; i++){gaussMask[i] = gaussMask[i] / sum;}
};
*.噪声模型
*.模型结构
这篇关于CycleISP环境配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!