HAT icon indicating copy to clipboard operation
HAT copied to clipboard

How can I infer my single img?

Open ShuxunoO opened this issue 2 years ago • 5 comments

I want to test the model with my demo img, how can I do this?

ShuxunoO avatar Sep 07 '23 03:09 ShuxunoO

Hello everyone, I've encountered a similar issue. Has anyone found a solution for it?

ZhiJingWu avatar Sep 14 '23 09:09 ZhiJingWu

modify the .yml file in options/test. For example, in HAT_GAN_Real_SRx4.yml

line 15
    dataroot_lq: input_dir

please modify it to a real folder path including your images.

This is my example:

line 15
    dataroot_lq: ./datasets/input_dir

I make a folder named input_dir in ./datasets/ and move a .png file to it. Then

python hat/test.py -opt options/test/HAT_GAN_Real_SRx4.yml

meisa233 avatar Sep 15 '23 03:09 meisa233

hello,Infer whether a single image was calculated using a GPU? I feel that my computing speed is a bit too slow, so I suspect that I haven't used GPU calculations. How should I check this

Nan1107 avatar Dec 20 '23 07:12 Nan1107

hello,Infer whether a single image was calculated using a GPU? I feel that my computing speed is a bit too slow, so I suspect that I haven't used GPU calculations. How should I check this

I haven't tested this code in a long time, but I probably remember it took a few seconds to infer an image. when you run your script, you can use nvidia-smi to see the Memory-Usage of your GPU. On the other hand, you can use torch.cuda.is_available() to check your cuda.

meisa233 avatar Dec 20 '23 07:12 meisa233

hello,Infer whether a single image was calculated using a GPU? I feel that my computing speed is a bit too slow, so I suspect that I haven't used GPU calculations. How should I check this

I haven't tested this code in a long time, but I probably remember it took a few seconds to infer an image. when you run your script, you can use nvidia-smi to see the Memory-Usage of your GPU. On the other hand, you can use torch.cuda.is_available() to check your cuda.

Thank you for your reply. It's the reason for my computer's insufficient performance

Nan1107 avatar Dec 20 '23 07:12 Nan1107