Closed Ranger-D closed 3 years ago
It's really a surprise that receive you reply.I did try torch.sum(model(new_image)). But I mean can I predict a picture without npy file? Because I need to get data from cameras instantly.
Never mind ,I have solved the problem,Thanks a lot.
Hello, do you know how to predict a picture with a trained-done model in pytorch ?
icoicqico @.***> 于2021年11月19日周五 上午11:34写道:
Hello, could you please share how you solved the problem? Thanks.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Pongpisit-Thanasutives/Variations-of-SFANet-for-Crowd-Counting/issues/23#issuecomment-973701551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMPC5QPWBHPTWZMORCJJOF3UMXAVPANCNFSM5GNONY4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@Ranger-D You can predict on a new image by
torch.sum(model(new_image))
. The model returns the density map, and you need to sum over all of the pixels to obtain the counts.