-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.py
56 lines (44 loc) · 1.44 KB
/
settings.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from pathlib import Path
import sys
import torch
# Get the absolute path of the current file
file_path = Path(__file__).resolve()
# Get the parent directory of the current file
root_path = file_path.parent
# Add the root path to the sys.path list if it is not already there
if root_path not in sys.path:
sys.path.append(str(root_path))
# Get the relative path of the root directory with respect to the current working directory
ROOT = root_path.relative_to(Path.cwd())
# DEvice
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Sources
IMAGE = 'Image'
VIDEO = 'Video'
SOURCES_LIST = [IMAGE, VIDEO]
# Images config
IMAGES_DIR = ROOT / 'images'
DEFAULT_DIR = ROOT / 'default'
DEFAULT_IMAGE = DEFAULT_DIR / 'GX010143.jpg'
DEFAULT_DETECT_IMAGE = DEFAULT_DIR / '143_detected.jpg'
# Video Config
VIDEO_RES = ROOT / 'Detected_Videos'
# ML Model config
MODEL_DIR = ROOT / 'weights'
DETECTION_MODEL = MODEL_DIR / 'SLseg_Vn.pt'
# DETECTION_MODEL = MODEL_DIR / 'jun26_urchin_seastar_cucumber.pt'
SEGMENTATION_MODEL = MODEL_DIR / 'SLseg_Vn.pt'
# SEGMENTATION_MODEL = DETECTION_MODEL
RESULTS_DIR = ROOT / 'Detected_Images'
DATA_DIR = ROOT / 'Dump'
#Colors
RED = (0,0,255)
GREEN = (0, 255, 0)
BLUE = (255, 0, 0)
CYAN = (255, 255, 0)
MAGENTA = (255, 0, 255)
YELLOW = (0, 255, 255)
WHITE = (255, 255, 255)
COLOR_LIST = (RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, WHITE)
#Web App breaks with a lot of detections, so it is limited here
MAX_DETECTION = 30