/*
 * Copyright 2019 Xilinx Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Important:
  ./test_jpeg_yolov4, ./test_performance_yolov4, ./test_video_yolov4 first param followed must be with model name.
  Valid model name:
    yolov4_leaky_spp_m
    yolov4_leaky_spp_m_pruned_0_36
    face_mask_detection_pt
    yolov4_leaky_416_tf
    yolov4_leaky_512_tf


1, compile

    execute the following command:

        sh build.sh

2, copy the compiled executable file and test image to the development board.

   run the executable file.

    sample : ./test_jpeg_yolov4 yolov4_leaky_spp_m sample_yolov4.jpg
    output : 
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0709 05:51:55.373807  4056 demo.hpp:1183] batch: 0     image: sample_yolov4.jpg
I0709 05:51:55.373944  4056 process_result.hpp:44] RESULT: 0    88.443  131.744 99.2484 149.025 0.435236
I0709 05:51:55.374065  4056 process_result.hpp:44] RESULT: 2    354.027 143.581 414.588 164.061 0.993462
I0709 05:51:55.374127  4056 process_result.hpp:44] RESULT: 2    2.66805 130.098 122.785 256     0.982919
I0709 05:51:55.374198  4056 process_result.hpp:44] RESULT: 2    115.5   139.702 184.125 180.433 0.979607
I0709 05:51:55.374258  4056 process_result.hpp:44] RESULT: 2    403.571 136.063 509.574 247.668 0.944256
I0709 05:51:55.374325  4056 process_result.hpp:44] RESULT: 2    324.955 142.011 358.98  157.237 0.915131
I0709 05:51:55.374380  4056 process_result.hpp:44] RESULT: 2    255.167 138.174 269.936 145.377 0.808019
I0709 05:51:55.374434  4056 process_result.hpp:44] RESULT: 2    298.174 136.298 328.2   153.551 0.804298
I0709 05:51:55.374490  4056 process_result.hpp:44] RESULT: 2    183.797 136.27  203.184 155.82  0.796352
I0709 05:51:55.374545  4056 process_result.hpp:44] RESULT: 2    271.403 139.977 285.278 147.181 0.759301
I0709 05:51:55.374598  4056 process_result.hpp:44] RESULT: 2    152.384 138.158 191.485 166.152 0.740953
I0709 05:51:55.374655  4056 process_result.hpp:44] RESULT: 2    170.626 136.453 201.079 155.692 0.698031
I0709 05:51:55.374709  4056 process_result.hpp:44] RESULT: 2    284.365 138.978 300.087 150.135 0.695229
I0709 05:51:55.374763  4056 process_result.hpp:44] RESULT: 2    203.411 138.573 216.445 149.054 0.66769
I0709 05:51:55.374816  4056 process_result.hpp:44] RESULT: 2    291.026 138.528 305.796 151.171 0.505759
I0709 05:51:55.374871  4056 process_result.hpp:44] RESULT: 2    244.192 138.931 256.436 143.582 0.404771
I0709 05:51:55.374923  4056 process_result.hpp:44] RESULT: 2    193.303 136.848 206.337 155.243 0.393966
I0709 05:51:55.374979  4056 process_result.hpp:44] RESULT: 2    233.618 138.585 245.863 143.236 0.34526


    sample : ./test_jpeg_yolov4 yolov4_leaky_spp_m_pruned_0_36 sample_yolov4.jpg
    output : 
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0317 12:55:35.748972  4333 demo.hpp:1183] batch: 0     image: sample_yolov4.jpg
I0317 12:55:35.749083  4333 process_result.hpp:44] RESULT: 0	88.4631	132.114	98.6138	148.348	0.450208
I0317 12:55:35.749434  4333 process_result.hpp:44] RESULT: 2	4.48846	131.158	123.311	255.129	0.988895
I0317 12:55:35.749553  4333 process_result.hpp:44] RESULT: 2	354.334	141.472	414.895	164.679	0.988712
I0317 12:55:35.749668  4333 process_result.hpp:44] RESULT: 2	112.493	138.58	185.341	182.039	0.980959
I0317 12:55:35.749776  4333 process_result.hpp:44] RESULT: 2	402.941	134.913	507.802	251.374	0.964191
I0317 12:55:35.749892  4333 process_result.hpp:44] RESULT: 2	151.627	137.104	190.729	166.903	0.857901
I0317 12:55:35.749997  4333 process_result.hpp:44] RESULT: 2	324.444	142.159	358.469	157.385	0.781579
I0317 12:55:35.750107  4333 process_result.hpp:44] RESULT: 2	254.411	139.154	270.133	144.764	0.751582
I0317 12:55:35.750208  4333 process_result.hpp:44] RESULT: 2	271.403	140.196	285.278	146.963	0.657634
I0317 12:55:35.750316  4333 process_result.hpp:44] RESULT: 2	301.743	137.05	333.706	153.258	0.640702
I0317 12:55:35.750418  4333 process_result.hpp:44] RESULT: 2	285.156	139.058	301.228	150.198	0.636388
I0317 12:55:35.750525  4333 process_result.hpp:44] RESULT: 2	204.177	139.521	215.679	148.21	0.627503
I0317 12:55:35.750628  4333 process_result.hpp:44] RESULT: 2	166.844	136.504	195.052	154.87	0.588446
I0317 12:55:35.750730  4333 process_result.hpp:44] RESULT: 2	203.97	138.357	217.003	145.561	0.492047
I0317 12:55:35.750830  4333 process_result.hpp:44] RESULT: 2	193.824	136.058	206.34	155.609	0.466655
I0317 12:55:35.750931  4333 process_result.hpp:44] RESULT: 2	186.827	136.322	200.701	155.904	0.438922
I0317 12:55:35.751036  4333 process_result.hpp:44] RESULT: 2	286.844	138.679	309.719	151.322	0.383322
I0317 12:55:35.751139  4333 process_result.hpp:44] RESULT: 7	293.047	136.044	332.148	153.023	0.332705

    sample : ./test_jpeg_yolov4 face_mask_detection_pt sample_face_mask.jpg
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0330 06:09:09.521342  2417 demo.hpp:1183] batch: 0     image: sample_face_mask.jpg
I0330 06:09:09.521709  2417 process_result.hpp:44] RESULT: 0	353.533	122.676	583.533	436.967	0.914165

    sample : ./test_jpeg_yolov4 yolov4_leaky_416_tf sample_yolov4.jpg
    output : 
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0526 01:52:27.207690 60223 process_result.hpp:44] RESULT: 0	88.1787	131.077	100.123	149.538	0.560786
I0526 01:52:27.207789 60223 process_result.hpp:44] RESULT: 2	5.673	132.408	122.127	254.254	0.995331
I0526 01:52:27.207851 60223 process_result.hpp:44] RESULT: 2	355.51	143.038	414.939	164.605	0.990851
I0526 01:52:27.207901 60223 process_result.hpp:44] RESULT: 2	402.152	142.644	512	233.958	0.988311
I0526 01:52:27.207952 60223 process_result.hpp:44] RESULT: 2	111.021	136.597	189.187	184.797	0.987387
I0526 01:52:27.208005 60223 process_result.hpp:44] RESULT: 2	323.742	141.474	360.665	159.206	0.848485
I0526 01:52:27.208048 60223 process_result.hpp:44] RESULT: 2	272.187	139.667	284.494	147.667	0.775378
I0526 01:52:27.208092 60223 process_result.hpp:44] RESULT: 2	255.296	138.925	271.1	145.156	0.720777
I0526 01:52:27.208134 60223 process_result.hpp:44] RESULT: 2	284.835	137.754	300.638	150.944	0.663573
I0526 01:52:27.208178 60223 process_result.hpp:44] RESULT: 2	301.036	136.306	333.503	154.768	0.643914
I0526 01:52:27.208221 60223 process_result.hpp:44] RESULT: 2	205.538	137.871	217.846	145.871	0.618293
I0526 01:52:27.208264 60223 process_result.hpp:44] RESULT: 2	152.452	137.386	189.375	166.621	0.618293
I0526 01:52:27.208308 60223 process_result.hpp:44] RESULT: 2	193.417	137.366	205.725	154.302	0.552065
I0526 01:52:27.208353 60223 process_result.hpp:44] RESULT: 2	184.172	137.026	203.357	155.2	0.494507
I0526 01:52:27.208400 60223 process_result.hpp:44] RESULT: 2	334.946	142.771	359.581	156.925	0.434068
I0526 01:52:27.208446 60223 process_result.hpp:44] RESULT: 2	171.475	134.85	200.23	157.619	0.433013
I0526 01:52:27.208489 60223 process_result.hpp:44] RESULT: 2	204.333	139.498	216.64	147.498	0.376004
I0526 01:52:27.208534 60223 process_result.hpp:44] RESULT: 2	169.511	137.138	194.797	155.599	0.37075
I0526 01:52:27.208580 60223 process_result.hpp:44] RESULT: 2	152.669	136.882	194.358	155.344	0.311417

    sample : ./test_jpeg_yolov4 yolov4_leaky_512_tf sample_yolov4.jpg
    output : 
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0526 01:51:50.369428 60212 process_result.hpp:44] RESULT: 0	91.9334	133.954	110.933	157.066	0.434068
I0526 01:51:50.369593 60212 process_result.hpp:44] RESULT: 0	88.9459	129.924	97.9209	147.924	0.320446
I0526 01:51:50.369707 60212 process_result.hpp:44] RESULT: 0	87.6714	132.283	99.1955	150.283	0.318674
I0526 01:51:50.369820 60212 process_result.hpp:44] RESULT: 2	-8.92278	135.69	133.077	252.125	0.992602
I0526 01:51:50.369943 60212 process_result.hpp:44] RESULT: 2	355.537	142.409	414.891	165.154	0.987856
I0526 01:51:50.370057 60212 process_result.hpp:44] RESULT: 2	104.855	140.109	190.982	182.943	0.98054
I0526 01:51:50.370172 60212 process_result.hpp:44] RESULT: 2	402.971	143.097	512	233.777	0.961547
I0526 01:51:50.370290 60212 process_result.hpp:44] RESULT: 2	338.003	142.991	357.003	157.009	0.813307
I0526 01:51:50.370400 60212 process_result.hpp:44] RESULT: 2	256.307	138.885	265.652	145.115	0.812103
I0526 01:51:50.370508 60212 process_result.hpp:44] RESULT: 2	328.987	142.951	357.024	156.746	0.812103
I0526 01:51:50.370620 60212 process_result.hpp:44] RESULT: 2	287.218	139.432	298.742	150.35	0.729251
I0526 01:51:50.370730 60212 process_result.hpp:44] RESULT: 2	206.348	138.49	215.693	146.49	0.724788
I0526 01:51:50.370839 60212 process_result.hpp:44] RESULT: 2	176.492	136.13	193.497	158.875	0.724788
I0526 01:51:50.370949 60212 process_result.hpp:44] RESULT: 2	305.235	136.076	329.632	154.076	0.71791
I0526 01:51:50.371058 60212 process_result.hpp:44] RESULT: 2	180.104	137.249	194.901	155.249	0.676414
I0526 01:51:50.371170 60212 process_result.hpp:44] RESULT: 2	272.086	139.019	283.611	147.522	0.674633
I0526 01:51:50.371269 60212 process_result.hpp:44] RESULT: 2	151.959	139.549	187.959	168.754	0.436741
I0526 01:51:50.371371 60212 process_result.hpp:44] RESULT: 2	264.858	139.375	272.137	145.605	0.429949
I0526 01:51:50.371469 60212 process_result.hpp:44] RESULT: 2	189.099	137.249	203.896	155.249	0.417059
I0526 01:51:50.371568 60212 process_result.hpp:44] RESULT: 2	284.793	138.134	300.202	148.406	0.376004
I0526 01:51:50.371670 60212 process_result.hpp:44] RESULT: 2	123.299	141.863	174.66	179.919	0.319516


Accuracy:
    ./test_accuracy_yolov4_mt <model_name> <image_list_filename> <output_filename> -t <thread>

    sample:
    ./test_accuracy_yolov4_mt yolov4_leaky_spp_m image_list.txt result.txt -t 2
