# Extract Layers Info

Utility "Extract Layers Info" is python3 scripts (recommended Python 3.6 or higher) that could be used for obtaining 
information about layers in neural networks IRs. Later this information could be saved in various formats: csv, html, etc.
Current version supports csv-files.

### How to obtain csv-files and upload them into spreadsheet
In this scenario data about IR's layers are written to csv-files for transformations into spreadsheet.
During working process script shows list of directories where it finds IRs and list of corresponding csv-files.

1. Goto script directory:

 * vpux-plugin/scripts/extract\_layers\_info/obtain\_csv\_files

2. Execute script with one or two additional parameters (1 - root directory where IRs and subdirs with IRs are situated, 2 - ouput directory for csv-files (by default it is named "results"):
	
 - `python3 extract_layers_info.py` `<root directory where IRs and subdirs with IRs are situated>` 

 or

 - `python3 extract_layers_info.py` `<root directory where IRs and subdirs with IRs are situated>`  `<output directory>`


3. You should see output like below with message about sucessful finishing of work:

 `Start looking for IR-files in directory: <root directory for IRs>`
 
 `Results will be saved in directory: <output directory>`

 `...`

 **some console output omitted**

 `...`
 
 `Data collection has been finished sucessfully.`

 `Now You could import csv-files to spreadsheet.`

4. In `<output directory>` you should see csv-files. These files are generated by script and could be used for creation of spreadsheet:

 * go to https://docs.google.com/spreadsheets/ and select `Blank` under title `Start a new spreadsheet` 

5. In new spreadsheet select "File->Import" and in appeared dialog select "Upload->Select file from your device". 
Navigate to `<output_directory>` and select file main.csv.
In next dialog select: `Replace current sheet` and press button `Import data`.

6. Select cells with "TRUE" and "FALSE" and select "Insert" -> "Checkbox". Also click on sheet title and rename it to main. 
If you like you could use colors, font resizing and other options for improvement of spreadsheet appearence. 
Now your could see main sheet of spreadsheet which shows all neural networks names and layers types.

7. For obtaining more detailed informaiton about each neural network go to bottom of main sheet and click on "+" sign for creating of new sheet in spreadsheet.
Rename this sheet with title of neural network of interest (for example "MobileNet_V2" or "ResNet-50") and go to this sheet.

8. Select File-Import and in appeared dialog select "Upload->Select file from your device".
Navigate to `<output directory>` and select csv-file with data for necessary neural network.
In next dialog select: "Replace current sheet" and press button "Import data".

9. Repeat steps 7-8 for all other neural networks.
