I2-Multimedia-Lab / CDFormer

86 stars 5 forks source link

option to use only lr images, for us to not prepairing datasets #2

Closed zelenooki87 closed 3 months ago

zelenooki87 commented 3 months ago

Could you add option to use only lr images, for us to not prepairing datasets. And btw, error code I am getting during inference:

python test_x2.py
in checkpoint
Traceback (most recent call last):
  File "C:\Users\Miki\CDFormer\test_x2.py", line 15, in <module>
    loader = data.Data(args)
  File "C:\Users\Miki\CDFormer\data\__init__.py", line 9, in __init__
    trainset = getattr(module_train, args.data_train)(args)             ## load the dataset, args.data_train is the  dataset name
  File "C:\Users\Miki\CDFormer\data\df2k.py", line 7, in __init__
    super(DF2K, self).__init__(args, name=name, train=train, benchmark=benchmark)
  File "C:\Users\Miki\CDFormer\data\multiscalesrdata.py", line 65, in __init__
    self.repeat = args.test_every // (len(self.images_hr) // args.batch_size)
ZeroDivisionError: integer division or modulo by zero
zbhfc712 commented 3 months ago

I think you should be in data/DF2K/HR in a few images, and then put the lr images in the data/benchmark/FreeData/HR and put data_test to FreeData in option.py .

zelenooki87 commented 3 months ago

same error again. copied same images to data/DF2K/HR and data/benchmark/FreeData/HR and changed in option.py and option_x2.py to Freedata

python test_x2.py in checkpoint Traceback (most recent call last): File "C:\Users\Miki\CDFormer\test_x2.py", line 15, in loader = data.Data(args) File "C:\Users\Miki\CDFormer\data__init.py", line 9, in init__ trainset = getattr(module_train, args.data_train)(args) ## load the dataset, args.data_train is the dataset name File "C:\Users\Miki\CDFormer\data\df2k.py", line 7, in init super(DF2K, self).init(args, name=name, train=train, benchmark=benchmark) File "C:\Users\Miki\CDFormer\data\multiscalesrdata.py", line 65, in init self.repeat = args.test_every // (len(self.images_hr) // args.batch_size) ZeroDivisionError: integer division or modulo by zero

model location CDFormer\experiment\cdformer_x2_bicubic_iso\model\model_1200.pt

@zbhfc712 Do you have success when running inference? Could you share some results?

zbhfc712 commented 3 months ago

What I tested is OK, maybe data/DF2K/HR needs at least four images or more.

zelenooki87 commented 3 months ago

Again same. BTW I am using Windows. all latest dependencies in conda env. Tried also in google colab, same error: /content/CDFormer in checkpoint Traceback (most recent call last): File "/content/CDFormer/test_x2.py", line 15, in loader = data.Data(args) File "/content/CDFormer/data/init.py", line 9, in init trainset = getattr(module_train, args.data_train)(args) ## load the dataset, args.data_train is the dataset name File "/content/CDFormer/data/df2k.py", line 7, in init super(DF2K, self).init(args, name=name, train=train, benchmark=benchmark) File "/content/CDFormer/data/multiscalesrdata.py", line 65, in init self.repeat = args.test_every // (len(self.images_hr) // args.batch_size) ZeroDivisionError: integer division or modulo by zero

Please check again. I am so excied to try this promising project. :)

zelenooki87 commented 3 months ago

And, could please consider adding licensing terms of your code?

zelenooki87 commented 3 months ago

Hi, @zbhfc712

I'm writing to follow up on the closure of the issue I reported. I'm still experiencing the problem, and I'm 100% certain it's not on my end. I've followed all the instructions carefully, and I've attached a screenshot for reference.

I'm also curious about the licensing issue. Why is it necessary to specify a license? I believe it would be beneficial for the Chainner project maintainers to include your architecture as an option for those of us who are less experienced.

Thank you for your time and consideration.

Skrinšot-0015
zbhfc712 commented 3 months ago

Looking at your screenshots, I wonder if data/DF2K/HR has more than four images, and secondly, we have not tested this project on windows. As for the licensing issue, we have not planned to join the licensing for the time being due to other reasons, and we have made the code open source. We reproduced your question on Linux and I think you can test your own data now that data/DF2K/HR has the data.

zelenooki87 commented 3 months ago

I'll try it on Ubuntu and let you know if I'm successful. Thanks for your patience.

zelenooki87 commented 3 months ago

same error on ubuntu: in checkpoint Traceback (most recent call last): File "/home/milan/cdformer/test_x2.py", line 15, in loader = data.Data(args) ^^^^^^^^^^^^^^^ File "/home/milan/cdformer/data/init.py", line 9, in init trainset = getattr(module_train, args.data_train)(args) ## load the dataset, args.data_train is the dataset name ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/milan/cdformer/data/df2k.py", line 7, in init super(DF2K, self).init(args, name=name, train=train, benchmark=benchmark) File "/home/milan/cdformer/data/multiscalesrdata.py", line 65, in init self.repeat = args.test_every // (len(self.images_hr) // args.batch_size)


ZeroDivisionError: integer division or modulo by zero

Could you please make google colab notebook to test your project?
zbhfc712 commented 3 months ago

I have re-downloaded my code to a new ubuntumachine and it works fine. I think you should check: data/DF2K/HR and data/benchmark/FreeData/HR. Even testing the model trainset needs to load at least one batch of data from data/DF2K/HR, making sure that data/DF2K/HR contains at least one batch of data.

zelenooki87 commented 3 months ago

comment below

zelenooki87 commented 3 months ago

You were right. We need more than 4 input files. The code runs, but I'm not getting the results I want. Can you take a look?

Fotografija-0095 start Fotografija-0095

your example: https://github.com/I2-Multimedia-Lab/CDFormer/raw/main/fig/iamge_040.gif

Do you have any advice on how to achieve denoised upscale as yours instead of just bicubic upscale? @zbhfc712 PS. I have tried all models

zbhfc712 commented 3 months ago

This is for blind image super-resolution, your image is obviously a real-world image, maybe you should look for real-world image super-resolution or image denoised.