Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions build_ovtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def main():
)

if arguments.use_openvino_from_location != '':
if not os.path.isdir(arguments.use_openvino_from_location):
raise AssertionError("Path doesn't exist {0}".format(
arguments.use_openvino_from_location))
ver_file = arguments.use_openvino_from_location + \
'/deployment_tools/inference_engine/version.txt'
if not os.path.exists(ver_file):
Expand Down Expand Up @@ -264,12 +267,13 @@ def main():
artifacts_location = os.path.abspath(arguments.artifacts_dir)

artifacts_location = os.path.abspath(artifacts_location)
print("ARTIFACTS location: " + artifacts_location)

#If artifacts doesn't exist create
if not os.path.isdir(artifacts_location):
os.mkdir(artifacts_location)

print("ARTIFACTS location: " + artifacts_location)

#install virtualenv
install_virtual_env(venv_dir)

Expand All @@ -283,8 +287,6 @@ def main():
if (arguments.target_arch):
target_arch = arguments.target_arch

print("Target Arch: %s" % target_arch)

# The cxx_abi flag is translated to _GLIBCXX_USE_CXX11_ABI
# For gcc older than 5.3, this flag is set to 0 and for newer ones,
# this is set to 1
Expand Down Expand Up @@ -339,7 +341,6 @@ def main():
os.chdir(cwd)
else:
if not arguments.build_tf_from_source:
print("Using TensorFlow version", tf_version)
print("Install TensorFlow")

if arguments.cxx11_abi_version == "0":
Expand Down Expand Up @@ -384,7 +385,6 @@ def main():
tf_src_dir = os.path.join(artifacts_location, "tensorflow")
print("TF_SRC_DIR: ", tf_src_dir)
# Download TF source for enabling TF python tests
pwd_now = os.getcwd()
if not os.path.exists(artifacts_location):
raise AssertionError(
"Path doesn't exist {0}".format(artifacts_location))
Expand All @@ -393,6 +393,8 @@ def main():
download_repo("tensorflow",
"https://github.com/tensorflow/tensorflow.git",
tf_version)
print("Using TensorFlow version", tf_version)
pwd_now = os.getcwd()
if not os.path.exists(pwd_now):
raise AssertionError("Path doesn't exist {0}".format(pwd_now))
os.chdir(pwd_now)
Expand Down
2 changes: 2 additions & 0 deletions examples/TF_1_x/object_detection_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ def load_labels(label_file):
elif input_mode == 'image':
images = [input_file]
elif input_mode == 'directory':
if not os.path.isdir(input_file):
raise AssertionError("Path doesn't exist {0}".format(input_file))
images = [os.path.join(input_file, i) for i in os.listdir(input_file)]
result_dir = os.path.join(input_file, '../detections')
if not os.path.exists(result_dir):
Expand Down
2 changes: 2 additions & 0 deletions examples/object_detection_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ def load_labels(label_file):
elif input_mode == 'image':
images = [input_file]
elif input_mode == 'directory':
if not os.path.isdir(input_file):
raise AssertionError("Path doesn't exist {0}".format(input_file))
images = [os.path.join(input_file, i) for i in os.listdir(input_file)]
result_dir = os.path.join(input_file, '../detections')
if not os.path.exists(result_dir):
Expand Down