Comments (3)
Hi, i want to test my owm images, but it always failed ,can you tell me how to set parameters? Thanks~
How to inference one image? When I try to inference on my own ToTensor code, it looks like not work .
`
sr_model = model.Model(args, checkpoint).cuda()
sr_model.eval()
img = cv2.imread('test2.jpg')
tensor = torch.from_numpy(img).float().permute(2, 0, 1)
tensor.mul_(1 / 255)
tensor = tensor.unsqueeze(0).cuda()
sr = sr_model(tensor, 0)
sr = quantize(sr,1)
normalized = sr.mul(255 / 1)
normalized = normalized.squeeze(0).permute(1, 2, 0).data.cpu().numpy()
cv2.imwrite('result.png',normalized)
`
from non-local-sparse-attention.
Hi, i want to test my owm images, but it always failed ,can you tell me how to set parameters? Thanks~
How to inference one image? When I try to inference on my own ToTensor code, it looks like not work .
`
sr_model = model.Model(args, checkpoint).cuda()sr_model.eval()
img = cv2.imread('test2.jpg')
tensor = torch.from_numpy(img).float().permute(2, 0, 1)
tensor.mul_(1 / 255)
tensor = tensor.unsqueeze(0).cuda()
sr = sr_model(tensor, 0)
sr = quantize(sr,1)
normalized = sr.mul(255 / 1)
normalized = normalized.squeeze(0).permute(1, 2, 0).data.cpu().numpy()
cv2.imwrite('result.png',normalized)
`
Sorry,I don't have time to test.
This is my test command:
'
python main.py --data_test Demo --dir_demo 'images dir' --chop --save_result --test_only --result 'save dir'
'
I think you can inference one image by modifying the code in here (/src/data/demo.py).
from non-local-sparse-attention.
Add --dir_demo <input folder>
and change --data_test Demo
and the model name. You will be good to go.
from non-local-sparse-attention.
Related Issues (20)
- 训练不了 HOT 7
- Issue about the Evaluation Metrics HOT 2
- flops
- Issue about the args.test_every HOT 2
- x3的model HOT 8
- 在Urban100上的测试结果偏差很大 HOT 2
- 论文简单来说就是Non-local Neural Networks中的NLA+Reformer中的LSH attention? HOT 1
- What does “common.MeanShift(args.rgb_range, rgb_mean, rgb_std, 1) ”do HOT 1
- Computational complexity HOT 2
- do you need to use the x2 model like EDSR to train the x3,x4 model? HOT 1
- Computational complexity HOT 2
- 关于代码实现 bucket_score 变量的细节疑惑? HOT 3
- TypeError: conv2d() received an invalid combination of arguments HOT 1
- Mean of query in the paper HOT 1
- How much memory of the GPUS was used for the test? HOT 1
- model code error HOT 1
- I get image just full of white
- Help with codes
- Cannot load dataset
- 训练的迭代次数
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 non-local-sparse-attention.