Sfoglia il codice sorgente

Hardcode the number of line candidates during evaluation

Yichao Zhou 7 anni fa
parent
commit
51e93780d5
2 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 4 1
      lcnn/models/line_vectorizer.py
  2. 2 2
      process.py

+ 4 - 1
lcnn/models/line_vectorizer.py

@@ -157,7 +157,10 @@ class LineVectorizer(nn.Module):
             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]

+ 2 - 2
process.py

@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
 """Process a dataset with the trained neural network
 Usage:
-    train.py [options] <yaml-config> <checkpoint> <image-dir> <output-dir>
-    train.py (-h | --help )
+    process.py [options] <yaml-config> <checkpoint> <image-dir> <output-dir>
+    process.py (-h | --help )
 
 Arguments:
    <yaml-config>                 Path to the yaml hyper-parameter file