README.md 5.25 KB
Newer Older
Matteo Spanio's avatar
Matteo Spanio committed
1
2
# Tape Irregularity Classifier

Matteo Spanio's avatar
Matteo Spanio committed
3
4
5
6
## Description
Implements the Technical Specification of [MPAI CAE-ARP](https://mpai.community/standards/mpai-cae/about-mpai-cae/#Figure2) *Tape Irregularity Classifier* AIM, providing:
* 2 Irregularity Files;
* Irregularity Images.
Matteo Spanio's avatar
Matteo Spanio committed
7
8

## Getting started
Matteo Spanio's avatar
Matteo Spanio committed
9
The *Tape Irregularity Classifier* is written in Python 3.10 which is therefore required to run the program.
Matteo Spanio's avatar
Matteo Spanio committed
10

Matteo Spanio's avatar
Matteo Spanio committed
11
12
## Installation
[PyYaml](https://pyyaml.org) is required for reading the configuration file. You can install it with:
Matteo Spanio's avatar
Matteo Spanio committed
13
```
Matteo Spanio's avatar
Matteo Spanio committed
14
15
16
17
18
19
20
21
22
23
pip install pyyaml
```
[OpenCV](https://docs.opencv.org/4.x/index.html) and [NumPy](https://numpy.org) are required for elaborating Irregularity Images. You can install them with:
```
pip install numpy
pip install opencv-contrib-python
```
Finally, [TensorFlow](https://www.tensorflow.org) is required for installing Keras and making neural network predictions. You can install it with:
```
pip install tensorflow
Matteo Spanio's avatar
Matteo Spanio committed
24
25
```

Matteo Spanio's avatar
Matteo Spanio committed
26
27
28
29
You can also use `requirements.txt` file to install all needed dependencies at once:
```
pip install -r requirements.txt
```
Matteo Spanio's avatar
Matteo Spanio committed
30

Matteo Spanio's avatar
Matteo Spanio committed
31
32
33
34
35
## Usage
Once the libraries are installed, you should customise the configuration file `config.yaml`.
There are two required parameters:
1. `WORKING_PATH` that specifies the working path where all input files are stored and where all output files will be saved;
2. `FILES_NAME` that specifies the name of the preservation files to be considered.
Matteo Spanio's avatar
Matteo Spanio committed
36

Matteo Spanio's avatar
Matteo Spanio committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
To execute the script without issues, the inner structure of the `WORKING_PATH` directory shall be like:
```
.
├── AccessCopyFiles
│   └── ...
├── PreservationAudioFile
│   ├── File1.wav
│   ├── File2.wav
│   └── ...
├── PreservationAudioVisualFile
│   ├── File1.mp4
│   ├── File2.mp4
│   └── ...
├── PreservationMasterFiles
│   └── ...
└── temp
    ├── File1
    │   ├── AudioAnalyser_IrregularityFileOutput1.json
    │   ├── AudioAnalyser_IrregularityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    ├── File2
    │   ├── AudioAnalyser_IrregularityFileOutput1.json
    │   ├── AudioAnalyser_IrregularityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    └── ...
```
`PreservationAudioFile` and `PreservationAudioVisualFile` directories contain the input of ARP Workflow, while `AccessCopyFiles` and `PreservationMasterFiles` directories contain its output. `temp` directory is used to store all files exchanged between the AIMs within the Workflow.
Matteo Spanio's avatar
Matteo Spanio committed
96

Matteo Spanio's avatar
Matteo Spanio committed
97
98
99
Please note that:
* Corresponding input files shall present the same name;
* The name of Irregularity Files given above is ***mandatory***.
Matteo Spanio's avatar
Matteo Spanio committed
100

Matteo Spanio's avatar
Matteo Spanio committed
101
With this structure, `FILES_NAME` parameter could be equal to `File1` or `File2`.
Matteo Spanio's avatar
Matteo Spanio committed
102

Matteo Spanio's avatar
Matteo Spanio committed
103
104
105
106
107
You can now launch the *Tape Irregularity Classifier* from the command line with:
```
python3 tapeIrregularityClassifier.py
```
Useful log information will be displayed during execution, requiring occasional interaction.
Matteo Spanio's avatar
Matteo Spanio committed
108

Matteo Spanio's avatar
Matteo Spanio committed
109
110
111
112
113
114
115
116
117
To enable integration in more complex workflows, it is also possible to launch the *Tape Irregularity Classifier* with command line arguments:
```
python3 tapeIrregularityClassifier.py [-h] -w WORKING_PATH -f FILES_NAME
```
If you use the `-h` flag:
```
python3 tapeIrregularityClassifier.py -h
```
all instructions will be displayed.
Matteo Spanio's avatar
Matteo Spanio committed
118
119

## Support
Matteo Spanio's avatar
Matteo Spanio committed
120
121
122
If you require additional information or have any problem, you can contact us at:
* Nadir Dalla Pozza (nadir.dallapozza@unipd.it);
* Niccolò Pretto (niccolo.pretto@unipd.it).
Matteo Spanio's avatar
Matteo Spanio committed
123
124

## Authors and acknowledgment
Matteo Spanio's avatar
Matteo Spanio committed
125
126
127
128
This project was developed by:
* Nadir Dalla Pozza (University of Padova);
* Niccolò Pretto (University of Padova);
* Sergio Canazza (University of Padova).
Matteo Spanio's avatar
Matteo Spanio committed
129

Matteo Spanio's avatar
Matteo Spanio committed
130
Developed with Python IDE [PyCharm Community](https://www.jetbrains.com/pycharm/).
Matteo Spanio's avatar
Matteo Spanio committed
131

Matteo Spanio's avatar
Matteo Spanio committed
132
133
## License
This project is licensed with [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.html).