how to inference
Closed this issue · 2 comments
syha2994 commented
hello. thanks for the nice code
How do I just infer an image?
JHC521PJJ commented
map_combined, map_st, map_ae = predict(input_img, teacher_model, student_model,
ae_model, teacher_mean, teacher_std,
q_st_start=q_st_start, q_st_end=q_st_end,
q_ae_start=q_ae_start, q_ae_end=q_ae_end)
map_combined = torch.nn.functional.pad(map_combined, (4, 4, 4, 4))
map_combined = torch.nn.functional.interpolate(
map_combined, (orig_height, orig_width), mode='bilinear')
map_combined = map_combined[0, 0].cpu().detach().numpy()
ad_score = np.max(map_combined)
the ad_score is your need.