-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using DISTS | ||
using Images | ||
|
||
# Read images | ||
ref = Images.load("../DISTS/images/r0.png") | ||
dist = Images.load("../DISTS/images/r1.png") | ||
|
||
# Load the pretrained network parameters and perceptual weights | ||
net_params, weights = load_weights("../DISTS/weights/net_param.mat", "../DISTS/weights/alpha_beta.mat") | ||
|
||
# Define resize image flag and use_gpu flag | ||
resize_img = true # If required. Its usage is not trivial. | ||
use_gpu = false # GPU acceleration is not implemented | ||
|
||
# Calculate the perceptual quality score (DISTS) | ||
@time score = DISTS_score(ref, dist, net_params, weights, resize_img, use_gpu; pretraining = "DISTS") | ||
|
||
# Output the score | ||
println("Perceptual quality score: ", score) |