December 2018
Intermediate to advanced
764 pages
18h 18m
English
Using the preceding functions, the accuracy of this system can be calculated. The following code can be used for calculating the optimum threshold:
import sysimport argparseimport osimport refrom sklearn.metrics import classification_reportfrom sklearn.metrics import accuracy_score
Now, the image paths are obtained from the folder, using the following code:
def get_image_paths(image_directory): image_names = sorted(os.listdir(image_directory)) image_paths = [os.path.join(image_directory, image_name) for image_name in image_names] return image_paths
The distances of the images are obtained when embeddings are passed, as shown in the following code:
def get_labels_distances(image_paths, embeddings): target_labels ...
Read now
Unlock full access