Face recognition model query

Hi,
I could see that you have created two python file named: fr_utils.py and inception_blocks_v2.py. Can you please let me know why did you created it if you are already downloading the model from facenet. I could see that u have uploaded some weights but can’t find the directory.

It sums it up, i wanted to know the purpose of these two python files and uploading weights from ./weights directory.

I am planning to create my own face recognition system and I was looking for some guidance.

thanks

You can learn the purpose by opening those .py files and reading the code.

1 Like

Exactly! Just click “File → Open” and have a look around. Also note that the cell in the notebook that loads the pretrained weights is this:

from tensorflow.keras.models import model_from_json

json_file = open('keras-facenet-h5/model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
model = model_from_json(loaded_model_json)
model.load_weights('keras-facenet-h5/model.h5')

I do not see any reference to a directory called “./weights”.

The directory “./weights” is present in fr_utils.py

PFB

def load_weights():
# Set weights path
dirPath = ‘./weights’
fileNames = filter(lambda f: not f.startswith(’.’), os.listdir(dirPath))
paths = {}
weights_dict = {}

But thanks, I found what I was looking for.
I was trying to find a way how to train with my own training images using pre-trained weights and now I found the logic.