Skip to content

Commit

Permalink
add some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindNilas committed Aug 25, 2024
1 parent ae2a9bc commit f22ab73
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
19 changes: 16 additions & 3 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ def getExe():
return ["main.exe"], version
else:
if platform.system() == "Linux":
version = subprocess.check_output(["python3.12", "main.py", "--version"]).decode().strip()
return ["python3.12", "main.py"], version
if os.path.exists("./main"):
version = subprocess.check_output(["./main", "--version"]).decode().strip()
return ["./main"], version
else:
version = subprocess.check_output(["python3.12", "main.py", "--version"]).decode().strip()
return ["python3.12", "main.py"], version
else:
version = subprocess.check_output(["python", "main.py", "--version"]).decode().strip()
return ["python", "main.py"], version
Expand All @@ -76,6 +80,7 @@ def runUpscaleBenchmark(inputVideo, executor):
"--benchmark",
"--outpoint", "16" if "-tensorrt" in method else "12"
]
print(f"Running command: {' '.join(cmd)}") # Debugging line
subprocess.run(cmd, check=True, cwd=os.path.dirname(os.path.abspath(__file__)))

fps = parseFPS()
Expand All @@ -98,6 +103,7 @@ def runInterpolateBenchmark(inputVideo, executor):
"--interpolate_method", method,
"--benchmark"
]
print(f"Running command: {' '.join(cmd)}") # Debugging line
subprocess.run(cmd, cwd=os.path.dirname(os.path.abspath(__file__)))

fps = parseFPS()
Expand All @@ -117,6 +123,7 @@ def runInterpolateBenchmark(inputVideo, executor):
"--ensemble",
"--outpoint", "20"
]
print(f"Running command: {' '.join(cmd)}") # Debugging line
subprocess.run(cmd, cwd=os.path.dirname(os.path.abspath(__file__)))

fps = parseFPS()
Expand Down Expand Up @@ -240,4 +247,10 @@ def parseSystemInfo():
print(f"Total models to benchmark: {TOTALTESTS}")
print(f"Using {' '.join(executor)} version {version}")
print("Current working directory:", os.getcwd())
runAllBenchmarks(executor, version, inputVideo)

# Check if the executable exists
exe_path = os.path.abspath(executor[0])
if not os.path.exists(exe_path):
print(f"Error: The executable {exe_path} does not exist.")
else:
runAllBenchmarks(executor, version, inputVideo)
8 changes: 8 additions & 0 deletions build-linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,18 @@ def move_extras():
except Exception as e:
print("Error while copying jsx file: ", e)

def clean_up():
benchmark_dir = os.path.join(base_dir, "dist", "benchmark")

try:
shutil.rmtree(benchmark_dir)
except Exception as e:
print("Error while deleting benchmark directory: ", e)

if __name__ == "__main__":
create_venv()
install_requirements()
install_pyinstaller()
create_executable()
move_extras()
clean_up()

0 comments on commit f22ab73

Please sign in to comment.