Skip to content

Commit

Permalink
Fix errors in smurf code.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 401825392
  • Loading branch information
AustinCStone authored and copybara-github committed Oct 8, 2021
1 parent 399f186 commit 0f17ea1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
1 change: 0 additions & 1 deletion smurf/apply_smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
except: # pylint:disable=bare-except
print('Missing cv2 dependency. Please install opencv-python.')

from cvx2 import latest as cv2 # pylint:disable=g-import-not-at-top


flags.DEFINE_string('data_dir', '', 'Directory with images to run on. Images '
Expand Down
26 changes: 26 additions & 0 deletions smurf/smurf_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@
import tensorflow as tf


from smurf import smurf_data
from smurf import smurf_flags
from smurf import smurf_plotting
from smurf import smurf_net

FLAGS = flags.FLAGS


def build_network(batch_size):
"""Builds the model architecture."""
return smurf_net.SMURFNet(
checkpoint_dir=FLAGS.checkpoint_dir,
optimizer=FLAGS.optimizer,
dropout_rate=0.,
feature_architecture=FLAGS.feature_architecture,
flow_architecture=FLAGS.flow_architecture,
size=(batch_size, FLAGS.height, FLAGS.width),
occlusion_estimation=FLAGS.occlusion_estimation,
smoothness_at_level=FLAGS.smoothness_at_level,
use_float16=True,
)


def evaluate():
"""Eval happens on GPU or CPU, and evals each checkpoint as it appears."""

candidate_checkpoint = None
smurf =build_network(batch_size=1)

Expand Down

0 comments on commit 0f17ea1

Please sign in to comment.