Skip to content

Commit

Permalink
Demo file in test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gsahonero committed Nov 18, 2024
1 parent ee91af2 commit 5c25762
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/demo.jl
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)

0 comments on commit 5c25762

Please sign in to comment.