-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
36 lines (30 loc) · 1.17 KB
/
constants.py
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
import json
import os
import glob
from pathlib import Path
with open("config/config.json") as c:
config = json.load(c)
with open("config/scraper_config.json") as c:
scraper_config = json.load(c)
#RASTERIZATION CONSTANTS
SIZE_W = config["size_w"] #Ensure values are big enough for matrix and tile W & H not be lesser than 1.
SIZE_H = config["size_h"]
TILE_X = config["tile_x"]
TILE_Y = config["tile_y"]
TILE_W = int(SIZE_W/TILE_X)
TILE_H = int(SIZE_H/TILE_Y)
MATRIX_X = config["matrix_x"]
MATRIX_Y = config["matrix_y"]
MATRIX_W = int(TILE_W/MATRIX_X)
MATRIX_H = int(TILE_H/MATRIX_Y)
FRAMES = glob.glob(os.path.join(f"data/frames/{config['frames_folder_name']}/*"))
OUTPUT_PATH = f"data/{config['frames_folder_name']}"
FILES = glob.glob(os.path.join("data/downloads/*"))
OVERRIDE_ASPECT_RATIO = config["override_aspect_ratio"]
COLLECTION_PATH = os.path.join("chromadb/collection")
COLLECTION_NAME = f"{SIZE_W}_{SIZE_H}_{TILE_X}{TILE_Y}{MATRIX_X}{MATRIX_Y}{OVERRIDE_ASPECT_RATIO}"
#SCRAPER CONSTANTS
API_KEY = scraper_config['api_key']
SEARCH_ENGINE_ID = scraper_config['search_engine_id']
WEBDRIVER = scraper_config["webdriver"]
SCRAPER_PATH = os.path.join(scraper_config["scraper_path"])