Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
images_preds = {}
for i, loaded_image_path in enumerate(loaded_image_paths):
images_preds[loaded_image_path] = {}
for _ in range(len(preds[i])):
images_preds[loaded_image_path][preds[i][_]] = probs[i][_]
return images_preds
if __name__ == '__main__':
print('\n Enter path for the keras weights, leave empty to use "./nsfw.299x299.h5" \n')
weights_path = input().strip()
if not weights_path: weights_path = "../nsfw.299x299.h5"
m = Classifier(weights_path)
while 1:
print('\n Enter single image path or multiple images seperated by || (2 pipes) \n')
images = input().split('||')
images = [image.strip() for image in images]
print(m.predict(images), '\n')