[Application] yolo v2 bug fix
authorSeungbaek Hong <sb92.hong@samsung.com>
Fri, 31 May 2024 04:27:18 +0000 (13:27 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 3 Jun 2024 00:36:18 +0000 (09:36 +0900)
register a custom layer that had been omitted on yolo v2.

**Self evaluation:**
1. Build test:   [X]Passed [ ]Failed [ ]Skipped
2. Run test:     [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Seungbaek Hong <sb92.hong@samsung.com>
Applications/YOLOv2/jni/main.cpp

index 018602e4089f3f24a9e2e7d7296bf528ad680640..4aeefab16db3545e1c0909ca77f3db9a0ec0d1fe 100644 (file)
@@ -284,6 +284,17 @@ int main(int argc, char *argv[]) {
   std::cout << "batch_size: " << BATCH_SIZE << " epochs: " << EPOCHS
             << std::endl;
 
+  try {
+    auto &app_context = nntrainer::AppContext::Global();
+    app_context.registerFactory(nntrainer::createLayer<custom::ReorgLayer>);
+    app_context.registerFactory(
+      nntrainer::createLayer<custom::YoloV2LossLayer>);
+  } catch (std::invalid_argument &e) {
+    std::cerr << "failed to register factory, reason: " << e.what()
+              << std::endl;
+    return 1;
+  }
+
   try {
     // create YOLO v2 model
     ModelHandle model = YOLO();