<jupyter_start><jupyter_text>Setting up Panorama<jupyter_code>class args:
    config_path = '../../trained_models/faces_config.json'
    k = 5
    model_path = \
        '../../trained_models/panorama_faces_original_loss_weights.h5'
    model_qualification_path = \
        '../../trained_models/panorama_faces_original_loss_weights.csv'
    target = 0.9
    margin = 44
    album_path = '../../trained_models/ytf_album.pkl'<jupyter_output><empty_output><jupyter_text>Loading configs<jupyter_code>config_gen = PanoramaConfig(args.config_path,
                                '',
                                '',
                                '',
                                '',
                                '',
                                args.model_path,
                                is_force=False
                                )

config = config_gen.get_config()
random.seed(config['random_seed'])<jupyter_output><empty_output><jupyter_text>Initializing PanoramaNet<jupyter_code>panoramaNet = PanoramaNet(config)
panoramaNet.load_weights(args.model_path)
panoramaNet.set_cas_param(args.model_qualification_path, auto=True)<jupyter_output>Loading weights from ../../trained_models/panorama_faces_original_loss_weights.h5<jupyter_text>Verification examplePass in a pair of frame and ask if there are any common identities depicted.<jupyter_code>frame_pair = ('./frame_0000147691.jpg', './frame_0000158434.jpg')
result, is_RM, short_circuited_at = panoramaNet.verify(frame_pair)
print(result, short_circuited_at)<jupyter_output>True 0<jupyter_text>Result is ```True``` and the query was short-circuited at ```Block_0``` and reference model was not needed.  Recognition examplePass in a single frame and an album of known objects to ask for the labels. First load the album into k-nn models. Pass ```voc=None``` meaning setting the vocabulary to be whatever is contained by the album.<jupyter_code>neigh, voc = panoramaNet.load_album(args.album_path, voc=None, k=args.k)<jupyter_output>No voc given<jupyter_text>Running recognitionThis is one frame from YoutubeFaces dataset depicting Osama Bin Laden. The album is also polled from the same dataset having a vocabulary size of 1588. This album contains frames from the same video as does our query.<jupyter_code>filename = "./Osama_bin_Laden_5_5.73.jpg"
result = panoramaNet.recognize(filename, neigh, k=args.k)<jupyter_output><empty_output><jupyter_text>The scores here are the distances between identities. The lower the more confident.<jupyter_code>result<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09304143862392494, 'fraction_numerical': 0.014464425332290852, 'mean_word_length': 3.4504347826086956, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '563113', 'license': 'Apache-2.0', 'n_tokens_mistral': 812, 'n_tokens_neox': 773, 'n_words': 171, 'path': 'panorama/examples/examples.ipynb', 'repo_name': 'makemebitter/Panorama-UCSD', 'size': '2558'}