mirror of
https://github.com/Shawn-Shan/fawkes.git
synced 2024-12-22 07:09:33 +05:30
Merge branch 'master' of https://github.com/Shawn-Shan/fawkes
This commit is contained in:
commit
d5f9e8b459
@ -1,3 +1,4 @@
|
||||
import errno
|
||||
import glob
|
||||
import gzip
|
||||
import json
|
||||
@ -259,9 +260,9 @@ def fix_gpu_memory(mem_fraction=1):
|
||||
def preprocess(X, method):
|
||||
assert method in {'raw', 'imagenet', 'inception', 'mnist'}
|
||||
|
||||
if method is 'raw':
|
||||
if method == 'raw':
|
||||
pass
|
||||
elif method is 'imagenet':
|
||||
elif method == 'imagenet':
|
||||
X = imagenet_preprocessing(X)
|
||||
else:
|
||||
raise Exception('unknown method %s' % method)
|
||||
@ -272,9 +273,9 @@ def preprocess(X, method):
|
||||
def reverse_preprocess(X, method):
|
||||
assert method in {'raw', 'imagenet', 'inception', 'mnist'}
|
||||
|
||||
if method is 'raw':
|
||||
if method == 'raw':
|
||||
pass
|
||||
elif method is 'imagenet':
|
||||
elif method == 'imagenet':
|
||||
X = imagenet_reverse_preprocessing(X)
|
||||
else:
|
||||
raise Exception('unknown method %s' % method)
|
||||
|
Loading…
Reference in New Issue
Block a user