use PATH constant
This commit is contained in:
parent
01e706fce6
commit
c8c481aed2
1 changed files with 5 additions and 2 deletions
|
|
@ -14,9 +14,12 @@ import os
|
||||||
import json
|
import json
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
|
# Get the absolute path to the current directory
|
||||||
|
PATH = os.path.abspath(__file__ + '/..')
|
||||||
|
|
||||||
# Read config from disk
|
# Read config from disk
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")
|
config.read(PATH + "/config.ini")
|
||||||
|
|
||||||
def stop(status):
|
def stop(status):
|
||||||
"""Stop the execution and close video stream"""
|
"""Stop the execution and close video stream"""
|
||||||
|
|
@ -41,7 +44,7 @@ dark_tries = 0
|
||||||
|
|
||||||
# Try to load the face model from the models folder
|
# Try to load the face model from the models folder
|
||||||
try:
|
try:
|
||||||
models = json.load(open(os.path.dirname(os.path.abspath(__file__)) + "/models/" + user + ".dat"))
|
models = json.load(open(PATH + "/models/" + user + ".dat"))
|
||||||
|
|
||||||
# Put all models together into 1 array
|
# Put all models together into 1 array
|
||||||
for model in models:
|
for model in models:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue