hitzhangyu / FLW-Net

Simplifying Low-Light Image Enhancement Networks with Relative Loss Functions
56 stars 9 forks source link

图片路径 #3

Closed sanjin222 closed 1 year ago

sanjin222 commented 1 year ago

filePath = 'F:/FlW-Net/low' filePath_high = 'F:/FlW-Net/high' 想请教一下,是只修改这个路径成自己的就可以运行了吗,Traceback (most recent call last): File "F:\FLW-Net\lowlight_test.py", line 132, in runtime,Loss_psnr,Loss_ssim = lowlight(image_name,image_high_name,expect_mean[i]) File "F:\FLW-Net\lowlight_test.py", line 31, in lowlight data_lowlight = Image.open(image_path) File "F:\ANACONDA3\envs\yolov7\lib\site-packages\PIL\Image.py", line 3218, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'F:/FlW-Net/low337.png',,,为什么运行test.py会报错呢?

hitzhangyu commented 1 year ago

看着像是路径导致的,改成这样试试? filePath = 'F:/FlW-Net/low/' filePath_high = 'F:/FlW-Net/high/'

sanjin222 commented 1 year ago

Traceback (most recent call last): File "E:\FLW-Net\lowlight_test.py", line 132, in runtime,Loss_psnr,Loss_ssim = lowlight(image_name,image_high_name,expect_mean[i]) File "E:\FLW-Net\lowlight_test.py", line 51, in lowlight low_im_filter_max = np.max(data_lowlight,axis=2,keepdims=True) # positive File "F:\ANACONDA3\envs\yolov7\lib\site-packages\numpy\core\fromnumeric.py", line 2810, in max return _wrapreduction(a, np.maximum, 'max', axis, None, out, File "F:\ANACONDA3\envs\yolov7\lib\site-packages\numpy\core\fromnumeric.py", line 88, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) numpy.exceptions.AxisError: axis 2 is out of bounds for array of dimension 2。非常感谢大佬的帮助,只修改路径运行又出现这样的错误是为什么呢,我是从事化学工程与技术专业的研究生,想用您的代码来处理图片,不是太懂,谢谢帮助解答啦

hitzhangyu commented 1 year ago

你输入的是灰度图?

sanjin222 commented 1 year ago

把灰度图改成了彩色图,请教一下有其他需要注意的地方吗?再次非常感谢!

sanjin222 commented 1 year ago

谢谢您的帮助,我将图片调整为1000×1000分辨率,test的代码跑通了,我想请教一下这个项目可以用来增强自己拍的低光照图片吗,能不能指点一些呢?

hitzhangyu commented 1 year ago

我的邮箱hitzhangyu@qq.com