Amitz244 commited on
Commit
a68965c
·
verified ·
1 Parent(s): 25dd93a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -74,10 +74,12 @@ def IQA_preprocess():
74
  ])
75
  return transform
76
 
77
- image = IQA_preprocess()(image).unsqueeze(0).to(device)
78
 
79
  with torch.no_grad():
80
- iqa_score = model(image).item()
 
 
81
 
82
  # maps the predicted score from the model's range [min_pred, max_pred]
83
  # to the actual range [min_score, max_score] using min-max scaling.
@@ -88,4 +90,4 @@ max_score =
88
  min_score =
89
 
90
  normalized_score = ((iqa_score - min_pred) / (max_pred - min_pred)) * (max_score - min_score) + min_score
91
- print(f"Predicted quality Score: {iqa_score:.4f}")
 
74
  ])
75
  return transform
76
 
77
+ batch = torch.stack([IQA_preprocess()(image) for _ in range(15)]).to(device) # Shape: (15, 3, 224, 224)
78
 
79
  with torch.no_grad():
80
+ iqa_score = model(batch).cpu().numpy()
81
+
82
+ iqa_score = np.mean(scores)
83
 
84
  # maps the predicted score from the model's range [min_pred, max_pred]
85
  # to the actual range [min_score, max_score] using min-max scaling.
 
90
  min_score =
91
 
92
  normalized_score = ((iqa_score - min_pred) / (max_pred - min_pred)) * (max_score - min_score) + min_score
93
+ print(f"Predicted quality Score: {normalized_score:.4f}")