Skip to content

Commit

Permalink
Add more output for troubleshooting help
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjycui committed Sep 23, 2021
1 parent b63fb93 commit 8defd64
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ backend.py -f <source> -e <extension> -c <colour> -b -d -l -g --static --block=<
-f <source> The directory from which the frames are stored (e.g. frames)
-e <extension> The extension of the frame files (e.g. png)
-c <colour> The colour of the lines to be drawn (e.g. #2464b4)
<<<<<<< HEAD
-b Reduce number of lines with bilateral filter
-d Download rendered frames automatically
-l Use L2 gradient, creates less edges but is still accurate: leads to faster renders)
=======
-b Reduce number of lines with bilateral filter for simpler renders
-d Download rendered frames automatically
-l Reduce number of lines with L2 gradient for quicker renders
>>>>>>> 5677318... Disable bilateral filter by default
-g Hide the grid in the background of the graph

-Optimisational options
Expand Down
16 changes: 14 additions & 2 deletions backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ def help():
print('\t-f <source>\tThe directory from which the frames are stored (e.g. frames)')
print('\t-e <extension>\tThe extension of the frame files (e.g. png)')
print('\t-c <colour>\tThe colour of the lines to be drawn (e.g. #2464b4)')
<<<<<<< HEAD
print('\t-b\t\tReduce number of lines with bilateral filter')
=======
print('\t-b\t\tReduce number of lines with bilateral filter for simpler renders')
>>>>>>> 5677318... Disable bilateral filter by default
print('\t-d\t\tDownload rendered frames automatically')
print('\t-l\t\tUse L2 gradient, creates less edges but is still accurate: leads to faster renders)')
print('\t-l\t\tReduce number of lines with L2 gradient for quicker renders')
print('\t-g\t\tHide the grid in the background of the graph\n')
print('-Optimisational options\n')
print('\t--static\t\t\t\t\tUse a static number of expressions per request block')
Expand Down Expand Up @@ -171,7 +175,15 @@ def get_expressions(frame):
print('Processing %d frames... Please wait for processing to finish before running on frontend\n' % len(os.listdir(FRAME_DIR)))

start = time()
frame_latex = pool.map(get_expressions, frame_latex)

try:
frame_latex = pool.map(get_expressions, frame_latex)
except cv2.error as e:
if str(e) == 'OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function \'cvtColor\'\n':
print('Unable to get one or more files. Remember image files should be named <DIRECTORY>/frame<INDEX>.<EXTENSION> where INDEX represents the frame number starting from 1 and DIRECTORY and EXTENSION are defined by command line arguments (e.g. frames/frame1.png). Please check if:\n\tThe files exist\n\tThe files are all valid image files\n\tThe name of the files given is correct as per command line arguments\n\tThe program has the necessary permissions to read the file.\n\nUse backend.py -h for further documentation\n')
else:
print(e)
sys.exit(2)

print('\r--> Processing complete in %.1f seconds\n' % (time() - start))

Expand Down

0 comments on commit 8defd64

Please sign in to comment.