<jupyter_start><jupyter_text>Demo arcface-tf2 encode on single image inputThis notebooks shows the testing results of the ArcFace model trained on Tensorflow2.0+.  Setup Environment<jupyter_code>!git clone https://github.com/peteryuX/arcface-tf2.git
%cd arcface-tf2/
!pip install -r requirements.txt<jupyter_output>Cloning into 'arcface-tf2'...
remote: Enumerating objects: 70, done.[K
remote: Counting objects:   1% (1/70)[K
remote: Counting objects:   2% (2/70)[K
remote: Counting objects:   4% (3/70)[K
remote: Counting objects:   5% (4/70)[K
remote: Counting objects:   7% (5/70)[K
remote: Counting objects:   8% (6/70)[K
remote: Counting objects:  10% (7/70)[K
remote: Counting objects:  11% (8/70)[K
remote: Counting objects:  12% (9/70)[K
remote: Counting objects:  14% (10/70)[K
remote: Counting objects:  15% (11/70)[K
remote: Counting objects:  17% (12/70)[K
remote: Counting objects:  18% (13/70)[K
remote: Counting objects:  20% (14/70)[K
remote: Counting objects:  21% (15/70)[K
remote: Counting objects:  22% (16/70)[K
remote: Counting objects:  24% (17/70)[K
remote: Counting objects:  25% (18/70)[K
remote: Counting objects:  27% (19/70)[K
remote: Counting objects:  28% (20/70)[K
remote: Counting objects:  30% (21/70)[K
remote: Counting objects:  31% (22/70)[K
remote: Count[...]<jupyter_text>Dowload Pretrained Model<jupyter_code>from google_drive_downloader import GoogleDriveDownloader as gdd

gdd.download_file_from_google_drive(file_id='<KEY>',
                                    dest_path='./arc_res50.zip',
                                    unzip=True)
!mkdir checkpoints
!mv arc_res50 checkpoints/arc_res50
!rm arc_res50.zip<jupyter_output>Downloading 1HasWQb86s4xSYy36YbmhRELg9LBmvhvt into ./arc_res50.zip... Done.
Unzipping...Done.<jupyter_text>The Source Image<jupyter_code>from IPython.display import Image
Image(filename='./data/BruceLee.jpg')<jupyter_output><empty_output><jupyter_text>Encoding Result from Testing Script<jupyter_code>import numpy as np
!python test.py --cfg_path="./configs/arc_res50.yaml" --img_path="./data/BruceLee.jpg"
encoded = np.load('./output_embeds.npy')
print(encoded.shape)
print(encoded)<jupyter_output>2020-02-19 15:25:46.098223: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2020-02-19 15:25:46.098328: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2020-02-19 15:25:46.098345: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
I0219 15:25:47.319335 140070095341440 utils.py:19] Detect 1 Physical GPUs, 1 Logical GPUs.
[*] load ckpt from ./checkpoints/arc_res50/e_8_b_40000.ckpt
[*] Encode ./data/BruceLee.jpg to ./output_embeds.npy
(1, [...]
{'fraction_non_alphanumeric': 0.1323529411764706, 'fraction_numerical': 0.08229036295369212, 'mean_word_length': 4.96455223880597, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '235306', 'license': 'MIT', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1163, 'n_words': 291, 'path': 'notebooks/colab-github-demo.ipynb', 'repo_name': 'liujuanLT/arcface-tf2', 'size': '3224'}