Comments (8)
@Elwarfalli You may directly input the gray images without any change and you would get "gray images" with three channels. Then you may simply convert the three-channel images to one-channel ones.
from hat.
When I applied that where the input is grayscale and I tested my pre-trained model the results were saved in 3 channels of grayscale. I am curious about PSNR; has PSNR computed for one grayscale channel? or how? and how can I change the code to save the results on a one-channel grayscale?
Thank you for your fast reply,
from hat.
@Elwarfalli PSNR is comupted on Y channel in the default settings. If you want to compute PSNR for comparing models on gray images, the best way is to retrain a model for gray images by setting the channel as 1 for complete fairness. If you just want to see the results of pretrained model on gray images, the most convenient way is to wirte a post-processing script to convert the three-channel images into gray channel like using Opencv BGR2Gray, and then compute PSNR on the one-channel images.
from hat.
Thank you,
from hat.
When I set the parameter as follows:
network structures
network_g:
type: HAT
upscale: 3
in_chans: 1
img_size: 64
window_size: 16
compress_ratio: 3
squeeze_factor: 30
conv_scale: 0.01
overlap_ratio: 0.5
img_range: 1.
depths: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
embed_dim: 180
num_heads: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
mlp_ratio: 2
upsampler: 'pixelshuffle'
resi_connection: '1conv'
I got an error:
output = module(*input, **kwargs)
File "C:\Users\Student.conda\envs\hat\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "e:\hamed\pycode\benchmarks\hat-master\hat\archs\hat_arch.py", line 980, in forward
x = self.conv_first(x)
File "C:\Users\Student.conda\envs\hat\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\Student.conda\envs\hat\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\Users\Student.conda\envs\hat\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Given groups=1, weight of size [180, 1, 3, 3], expected input[1, 3, 16, 16] to have 1 channels, but got 3 channels instead
Any help, please?
Thank you,
from hat.
@Elwarfalli You need modify the data loader for 1-channel images I/O. Create a custom data loader referring to paired_image_dataset.py.
from hat.
Based on my understating, BasicSR paired_image_dataset.py papers the dataset. I have my own grayscale dataset training/validation.
from hat.
@Elwarfalli I mean you need to create your own data loader to fit your dataset. Read this file just as the reference.
from hat.
Related Issues (20)
- SR replication results mismatch reported values on certain datasets HOT 5
- 训练iteration数? HOT 4
- fine tuning Real_HAT_mse model with paired dataset HOT 2
- Scale by 2 or 8?
- 单通道训练问题 HOT 3
- RuntimeError: NCCL invalid usage HOT 1
- Having problem while Training on low resolution images
- How to use the package in Mac with M1/M2 chip
- How you calculate macs and params?
- Inquiry on HAT Application for Same-Size Super Resolution HOT 5
- How to modify basicsr code and apply to HAT model? HOT 2
- Can't Reproduce the Results of SRx3
- How can I calculate PSNR&SSIM with only LR images in HAT_SRX4_ImageNet-LR.yml?Thank you!
- Does the Real-HAT have a small version like HAT-S? HOT 6
- Half precision (fp16) Training and Inference of the HAT models HOT 3
- TypeError: calculate_psnr() missing 1 required positional argument: 'img2' HOT 2
- Tại bài hát mới
- Question about the forward method HOT 3
- 1x模型权重
- How to limit the range of the super-resolved image HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hat.