The following folder structure is required to run the retraining process.
#### Before Preprocessing:
Assumption: Your pictures from coco is in jpg files in the `cocoapi/images/train/` subfolder and the coco annotation files are in the `cocoapi/annotations/train/` subfolder.
```
cocoapi/
images/
train/
*.jpg
annotations/
train/
instances_train2017.json
captions_train2017.json
```
#### After Preprocessing:
*[exract_multilabel_pics.py](/preprocessing/coco_preprocessing/extract_multilabel_pics.py) will create the following folders and files (images for multilabel training):
```
cocoapi/
multilabel_outer/
multilabel_images/
*.jpg
```
*[categories_of_pictures.py](/preprocessing/coco_preprocessing/categories_of_pictures.py) will create the following folders and files (labels for multilabel training):
```
cocoapi/
images_txt/
*.txt
```
*[categories_labels.py](/preprocessing/coco_preprocessing/categories_labels.py) will create the following file (categories of coco):
```
cocoapi/
labels.txt
```
#### Retraining
@@ -123,7 +168,7 @@ ALL_LABELS_FILE is a text file that contains all the labels.
***Restriction:**
Because extracting all vectors from images took too long we limited the dataset to 100 pictures per category, resulting in 8000 vectors total (which are used as input for the LSTM). We expect that this decision will get us inferior end results, but had to be done to stay within time limits.
* to create an equal distribution without intersecting pictures we used the following [script](cnn/preprocessing/100.py):
* to create an equal distribution without intersecting pictures we used the following [script](preprocessing/coco_preprocessing/100.py):
```
python 100.py
```
@@ -140,6 +185,8 @@ python 100.py
***Workflow:**
See [example notebook](/lucid/Visualization - singlelabel.ipynb)
Note that different models have different architectures and layers.
To extract the layers of a given model we used [this](/preprocessing/graph_reader.py) script.