Commit 0308208b authored by Maria Kleppestø Mcculloch's avatar Maria Kleppestø Mcculloch
Browse files

Merge branch 'main' of...

Merge branch 'main' of https://gitlab.stud.idi.ntnu.no/mariakmc/imt4126-biometricqualitymetrics into main
parents 22e34313 b9fdf03b
......@@ -2,10 +2,94 @@
This is the documentation of the code for the project
### Install Third party Libraries
As the script depends on the ArcFace library to compute the scores, this library needs to be installed first.
The library installation can be found here: https://github.com/deepinsight/insightface/tree/master/python-package
### Dependencies
As the script depends on the ArcFace library to compute the scores, this library needs to be installed first.
The library installation can be found here: https://github.com/deepinsight/insightface
## Running the opertaions
In theory all 3 operations can be run in the same instance, or in three sepearate runs. It can be beneficial to perform the operationsin two runs; first compute the baselines, and then compute and plot the metrics. For details on how to perform these three operations, read the following sections:
### 0. Setting project path
in main.py, Change the projectpath to the project path as it is on your local machine
`` projectpath = "my/project/path/" ``
### 1. Computing the baseline.
One can use the code present in main.py to compute the baseline.
#### i. Uncomment the following lines in main.py:
``QualEval = QualityEvaluator("ArcFaceCasiaV2", projectpath, imgsdir, "subjectnr/samplenr")``
``QualEval.ArcFace_init()``
``QualEval.readInDataset(params, projectpath, imgsdir, "ArcFaceCasia", True ) ``
``QualEval.ComputeBaselines()``
``QualEval.SaveBaslines()``
#### ii. Run main.py
### 2. Compute quality metrics
#### i. Uncomment the following lines in main.py:
``QualEval = QualityEvaluator("ArcFaceCasiaV2", projectpath, imgsdir, "subjectnr/samplenr")``
``QualEval.Detection_Arcface_init()``
``QualEval.ComputeMetric("sharpness", params[0], params[1])``
``QualEval.ComputeMetric("focus", params[0], params[1])``
``QualEval.SaveMetric("sharpness")``
``QualEval.SaveMetric("focus")``
``
#### ii. Run main.py
#### iii. Run the script computeBrisque.m.
### 3. Plot quality metrics
NB! If the metrics have not been computet (aka there is no data/[name].npy files or data/brisque/[name].csv) this will fail. Make sure the metrics have been computed, either in this or a previous run.
#### i. Uncomment the following lines in main.py:
``QualEval = QualityEvaluator("ArcFaceCasiaV2", projectpath, imgsdir, "subjectnr/samplenr")``
``QualEval.PlotMetric("EDC", "focus",subnr=params[0], sampnr=params[1])``
``QualEval.PlotMetric("EDC", "sharpness",subnr=params[0], sampnr=params[1])``
``QualEval.PlotMetric("EDC", "brisque",subnr=params[0], sampnr=params[1], metric_name="data/brisque/quality_values_aug")``
``QualEval.PlotMetric("DET", "focus",subnr=params[0], sampnr=params[1])``
``QualEval.PlotMetric("DET", "sharpness",subnr=params[0], sampnr=params[1])``
``QualEval.PlotMetric("DET", "brisque",subnr=params[0], sampnr=params[1], metric_name="data/brisque/quality_values_aug")``
``QualEval.PlotDETCurve(params[0],params[1])``
#### ii. Run main.py
It also depends on a third party DET script.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment