File size: 1,434 Bytes
21c7197 3cf0931 21c7197 3cf0931 0908a41 21c7197 3cf0931 21c7197 3cf0931 0908a41 21c7197 3cf0931 21c7197 3cf0931 21c7197 3cf0931 fa707a9 21c7197 0908a41 3cf0931 21c7197 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
"All the constants used in this repo."
from pathlib import Path
# This repository's directory
REPO_DIR = Path(__file__).parent
# This repository's main necessary folders
MATCHERS_PATH = REPO_DIR / "matchers"
KEYS_PATH = REPO_DIR / ".fhe_keys"
CLIENT_TMP_PATH = REPO_DIR / "client_tmp"
SERVER_TMP_PATH = REPO_DIR / "server_tmp"
# Create the necessary folders
KEYS_PATH.mkdir(exist_ok=True)
CLIENT_TMP_PATH.mkdir(exist_ok=True)
SERVER_TMP_PATH.mkdir(exist_ok=True)
# All the filters currently available in the demo
AVAILABLE_MATCHERS = [
"random guessing",
# "random guessing concrete 1.1.0",
# "random guessing concrete 1.1.0",
# "static distance",
# "MLP-based learned distance",
# "CNN-based learned distance",
]
# The input images' shape. Images with different input shapes will be cropped and resized by Gradio
INPUT_SHAPE = (100, 100)
# Retrieve the input examples directory
INPUT_EXAMPLES_DIR = REPO_DIR / "input_examples"
# List of all image examples suggested in the demo
ID_EXAMPLES = [str(image) for image in (INPUT_EXAMPLES_DIR / "ids").glob("**/*")]
SELFIE_EXAMPLES = [
str(image) for image in (INPUT_EXAMPLES_DIR / "selfies").glob("**/*")
]
# Encrypted image and output names
ENCRYPTED_QUERY_NAME = "encrypted_query_image"
ENCRYPTED_REFERENCE_NAME = "encrypted_reference_image"
ENCRYPTED_OUTPUT_NAME = "encrypted_output"
# Store the server's URL
SERVER_URL = "http://localhost:8000/"
|