-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.py
49 lines (41 loc) · 1.07 KB
/
config.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
import os
import cv2
import json
import glob
import random
import numpy as np
from tqdm import tqdm
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.metrics import MeanIoU, Mean
from tensorflow.keras.losses import SparseCategoricalCrossentropy, CategoricalCrossentropy
DATASET_DIR = "dataset"
BASE_DIR = os.path.dirname(__file__)
DATASET_DIR = os.path.join(BASE_DIR, DATASET_DIR)
# Input dimensions
INPUT_WIDTH = 320
INPUT_HEIGHT = 240
# Output dimensions
OUTPUT_WIDTH = 320
OUTPUT_HEIGHT = 240
NUMBER_OF_CLASSES = 3
BATCH_SIZE = 64
EPOCH_NUMBER = 200
LEARNING_RATE = 0.001
# read datasheet
# with open(BASE_DIR + "/dataset/label_classes.json", "r") as js:
# file = json.load(js)
# js.close()
# # import color map
# COLOR_MAP = {}
# for item in file:
# name = item["name"]
# color = item["png_index"]
# COLOR_MAP[name] = color
# i have consider ball and line as one class
COLOR_MAP = { #bgr
'background': [0.0, 0.0, 0.0],
'field': [0.0, 255.0, 0.0],
'line': [255.0, 255.0, 255.0]
}