Skip to content

Commit

Permalink
flask apache current dir abs
Browse files Browse the repository at this point in the history
  • Loading branch information
pijoules committed Apr 2, 2016
1 parent 5a266af commit f43b028
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
import classify
import base64
import requests
import os
import numpy as np

ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])
COMPARISONS_DIR = "comparisons"
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
COMPARISONS_DIR = os.path.join(CURRENT_DIR, "comparisons")


def allowed_file(filename):
Expand Down
1 change: 1 addition & 0 deletions classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def fname_to_name(fname, dirname):
fname = re.sub('^' + dirname + '\/', '', fname)
fname = re.sub('\.(jpg|png|jpeg)', '', fname)
fname = re.sub('-', ' ', fname)
fname = re.sub('_', '', fname)
return fname


Expand Down
Binary file added comparisons/pepe_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f43b028

Please sign in to comment.