-
Install Anaconda https://docs.anaconda.com/free/anaconda/install/
-
Create Environment
$ conda create -n tf python=3.9
$ conda activate tf
-
Install Tensorflow + CUDA
Linux https://www.tensorflow.org/install/pip#linux_setup
Windows https://www.tensorflow.org/install/pip#windows-native
Training a classification CNN
$ python example_convnet.py
At the end, you will have the folder "mnist_model" with the model saved.
Now, you can use the model for similarity search in other dataset like EMNIST-LETTERS. To test this example, please, download the emnist dataset in npy format from here.
After downloading you will have two files:
- data/test_emnist_images.npy
- data/test_emnist_labels.npy
Now, you can try this:
$ python ssearch_emnist.py
After running, you will have some image retrieval results. Please see the images named "result_.png". Examples of these results are:
This shows that we can use a pretrained model for other different but similar problem. We say similar because images comes from the same nature. In this case, letters from emnist and digits from mnist are all handwritten symbols.
In addition, you can visualize the feature space projecting the original features to 2D points using UMAP (see umap_view.py). Below is an example of the space representation on emnist dataset.




