Commit 6d38327f authored by Maria Kleppestø Mcculloch's avatar Maria Kleppestø Mcculloch
Browse files

Update README.md

parent 4a6c2c66
......@@ -2,72 +2,94 @@
This is the documentation of the code for the project
### Install Third party
### 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
The library installation can be found here: https://github.com/deepinsight/insightface/tree/master/python-package
It also depends on a third party DET script.
### Running the opertaions
It can be beneficial to perfor the operations in two runs; first compute the baselines, and then compute and plot the metrics.
## Running the opertaions
### Computing the baseline.
One can use the code present in main.py to compute the baseline. In order to achive this, one needs to
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:
1. Change the projectpath the project paht as it is on your local machine
### 0. Setting project path
`` projectpath = "my/project/path/ ``
in main.py, Change the projectpath to the project path as it is on your local machine
2. Uncomment the following lines:
`` projectpath = "my/project/path/" ``
``
QualEval = QualityEvaluator("Instance-Name", projectpath, imgsdir, "subjectnr/samplenr")
QualEval.ArcFace_init()
QualEval.readInDataset(params, projectpath, imgsdir, "ArcFaceCasia", True )
QualEval.ComputeBaselines()
QualEval.SaveBaslines()
### 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:
### Compute quality metrics
1. Change the projectpath in main.py the project paht as it is on your local machine
`` projectpath = "my/project/path/ ``
2. Uncomment the following lines in main.py:
``QualEval = QualityEvaluator("ArcFaceCasiaV2", projectpath, imgsdir, "subjectnr/samplenr")``
``
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")
``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")``
``
3. Run the script computeBrisque.m.
#### 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])``
### Plot quality metrics
``QualEval.PlotMetric("EDC", "sharpness",subnr=params[0], sampnr=params[1])``
1. Change the projectpath the project paht as it is on your local machine
``QualEval.PlotMetric("EDC", "brisque",subnr=params[0], sampnr=params[1], metric_name="data/brisque/quality_values_aug")``
`` projectpath = "my/project/path/ ``
``QualEval.PlotMetric("DET", "focus",subnr=params[0], sampnr=params[1])``
2. Uncomment the following lines in main.py:
``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 = 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])
``QualEval.PlotDETCurve(params[0],params[1])``
#### i. Run main.py
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