From 51e93780d53d34110cb8a2e5a07e42effe6301f2 Mon Sep 17 00:00:00 2001 From: Yichao Zhou Date: Wed, 24 Jul 2019 02:44:49 -0700 Subject: [PATCH] Hardcode the number of line candidates during evaluation --- lcnn/models/line_vectorizer.py | 5 ++++- process.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lcnn/models/line_vectorizer.py b/lcnn/models/line_vectorizer.py index 9b6f9f3..087ec7a 100644 --- a/lcnn/models/line_vectorizer.py +++ b/lcnn/models/line_vectorizer.py @@ -157,7 +157,10 @@ def sample_lines(self, meta, jmap, joff, do_evaluation): jmap = non_maximum_suppression(jmap).reshape(n_type, -1) joff = joff.reshape(n_type, 2, -1) N = len(junc) - K = min(int(N * 2 + 2), M.n_dyn_junc // n_type) + if do_evaluation: + K = 440 + else: + K = min(int(N * 2 + 2), M.n_dyn_junc // n_type) device = jmap.device # index: [N_TYPE, K] diff --git a/process.py b/process.py index 7cdf156..be1f8d0 100755 --- a/process.py +++ b/process.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 """Process a dataset with the trained neural network Usage: - train.py [options] - train.py (-h | --help ) + process.py [options] + process.py (-h | --help ) Arguments: Path to the yaml hyper-parameter file