Skip to content

Instantly share code, notes, and snippets.

@Praveen76
Created July 29, 2020 05:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Praveen76/7f2c5ac99b5cab02ea38f61254badaba to your computer and use it in GitHub Desktop.
from glob import glob
model_paths = glob('snapshots/resnet50_csv_0*.h5')
latest_path = sorted(model_paths)[-1]
print("path:", latest_path)
from keras_retinanet import models
model = models.load_model(latest_path, backbone_name='resnet50')
model = models.convert_model(model)
label_map = {}
for line in open('../maskDetectorClasses.csv'):
row = line.rstrip().split(',')
label_map[int(row[1])] = row[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment