diff --git a/data/box_prediction/result_000000.txt b/data/box_prediction/result_000000.txt new file mode 100644 index 0000000..845c778 --- /dev/null +++ b/data/box_prediction/result_000000.txt @@ -0,0 +1,54 @@ +19.2525 -3.68967 -0.740123 3.76747 1.60762 1.54503 5.98195 0 0.740643 +18.2819 -7.31069 -0.547517 1.72735 0.540064 1.77203 6.31274 2 0.478917 +4.54295 -4.49186 -0.854729 0.849818 0.557835 1.63982 6.70139 1 0.392249 +17.06 -10.0449 -0.436886 1.8012 0.622777 1.61363 1.42663 2 0.342554 +9.90103 10.7319 -0.422058 1.69177 0.567125 1.72643 6.02963 2 0.335205 +15.1356 -6.59019 -0.539101 0.761381 0.619497 1.68187 2.3656 1 0.328514 +0.722502 -19.7131 -0.769733 1.96168 0.540504 1.7744 5.30073 2 0.310377 +10.6275 7.99949 -0.567717 0.828645 0.654609 1.77226 1.53268 1 0.309834 +6.83004 -0.843898 -0.813113 1.1066 0.530223 1.79107 1.19941 1 0.301984 +13.4292 -8.4793 -0.440017 0.857044 0.622605 1.73636 1.98977 1 0.29926 +24.2977 -8.53816 -0.482462 0.812987 0.635705 1.82505 1.86519 1 0.29744 +12.8221 -9.45378 -0.312659 0.815815 0.608476 1.73574 3.55534 1 0.270971 +5.89162 9.10498 -0.493716 1.78018 0.671843 1.81494 2.98788 2 0.259712 +9.60762 8.25069 -0.622208 0.59761 0.681849 1.68519 5.73692 1 0.25454 +6.04709 -5.20427 -0.699844 0.988852 0.609779 1.76992 4.45323 1 0.246044 +8.60862 -1.44515 -0.719669 1.10808 0.695667 1.83978 4.30186 1 0.236525 +5.42723 -8.19001 -0.540127 1.81956 0.649145 1.699 1.40448 2 0.223648 +13.8518 -7.17738 -0.446776 0.795653 0.579149 1.76937 3.13414 1 0.219857 +19.6133 5.99753 -0.658351 1.67403 0.553954 1.70479 2.6831 2 0.21602 +6.437 -10.3421 -0.421585 0.642891 0.604661 1.72777 1.53555 1 0.213535 +12.8628 -11.6671 -0.400966 1.65383 0.440011 1.54643 5.92844 2 0.198192 +65.8986 -12.7396 -0.0313683 3.70282 1.70222 1.62919 5.76714 0 0.193373 +5.20625 -5.05614 -0.719639 0.968831 0.54779 1.7815 1.6024 1 0.190432 +8.69372 9.36892 -0.485356 0.916247 0.585208 1.77723 4.99068 1 0.186119 +15.4386 -9.03904 -0.270222 0.818707 0.637741 1.72764 2.58393 1 0.185152 +5.15422 -6.48135 -0.665345 0.943566 0.591122 1.73689 4.73644 1 0.182584 +1.16231 -3.96315 -0.924803 0.697707 0.594826 1.63792 3.07256 1 0.180129 +3.5197 9.55207 -0.555191 0.863009 0.585274 1.79425 1.75132 1 0.17989 +14.2075 -7.761 -0.380176 0.713982 0.586602 1.75285 6.66459 1 0.179555 +6.12557 -1.71322 -0.774622 0.900965 0.608192 1.75847 2.06455 1 0.1683 +4.46995 9.38771 -0.506404 0.829931 0.592847 1.77272 1.6961 1 0.157574 +16.6657 -7.33419 -0.582628 1.74412 0.615046 1.65418 1.2543 2 0.155842 +8.66377 8.46946 -0.525525 0.775273 0.626409 1.73986 3.14877 1 0.154209 +66.6719 -17.1794 -0.802488 4.00322 1.63542 1.5387 1.33938 0 0.146009 +7.75491 9.46398 -0.521226 0.890605 0.577691 1.7723 1.96749 1 0.142551 +14.7122 -7.23659 -0.68566 0.649213 0.427413 1.39092 2.72346 1 0.141562 +6.73731 9.71833 -0.452598 0.842762 0.622094 1.82172 1.70626 1 0.138563 +5.77692 -6.18109 -0.686638 0.981488 0.559035 1.76772 1.39746 1 0.136399 +1.59556 9.7761 -0.570281 0.863996 0.619516 1.78781 1.55572 1 0.134914 +3.89671 -7.83833 -0.744396 0.909932 0.491044 1.63342 4.48379 1 0.134512 +40.8547 -12.5178 -0.046631 1.75794 0.646368 1.86273 1.35099 2 0.133201 +32.0194 3.92625 -0.613057 1.84686 0.508992 1.76663 2.92574 2 0.131012 +13.1267 21.6375 0.483126 1.68949 0.500352 1.7048 6.29065 2 0.128115 +1.89736 -22.6539 -0.90497 0.608382 0.637706 1.80058 5.63541 1 0.12128 +6.75475 -5.86429 -0.64016 0.897214 0.578738 1.74378 4.74902 1 0.120861 +15.796 -11.3973 -0.331104 0.753703 0.646887 1.80272 6.11973 1 0.112578 +16.2609 -12.381 -0.328922 1.64537 0.405017 1.67858 5.82137 2 0.111765 +2.83938 -12.7032 -0.565101 0.669205 0.521711 1.56195 5.42309 1 0.111468 +3.59065 10.4239 -0.434171 0.750946 0.5862 1.85022 2.0087 1 0.106648 +3.74251 -14.0518 -0.534105 0.505382 0.500283 1.67901 5.87452 1 0.105862 +2.55154 9.78444 -0.574731 0.825701 0.574495 1.83204 1.5156 1 0.105147 +2.9376 10.7125 -0.581239 0.450458 0.611728 1.69688 5.3546 1 0.102237 +4.49447 10.4129 -0.541822 0.623137 0.523313 1.66895 1.2767 1 0.101939 +7.03311 -10.5074 -0.319436 0.671526 0.600508 1.72631 4.65332 1 0.101289 diff --git a/data/box_prediction/result_000001.txt b/data/box_prediction/result_000001.txt new file mode 100644 index 0000000..f397265 --- /dev/null +++ b/data/box_prediction/result_000001.txt @@ -0,0 +1,12 @@ +15.7547 20.9911 -0.0442055 6.19737 1.95906 4.50539 4.71653 0 0.284317 +48.1508 27.1515 -0.806718 3.92252 1.61223 2.02372 2.94806 0 0.177582 +50.6693 2.45035 -0.81901 3.89947 1.54243 2.3025 3.35659 0 0.171959 +14.6796 12.3233 -0.676169 4.34419 2.14838 2.66682 4.94091 0 0.140459 +6.34734 -5.6618 -1.23541 0.472425 0.318869 1.08704 3.27788 1 0.130787 +68.577 -4.98186 -0.111188 4.25189 1.59348 1.51207 3.2389 0 0.130434 +13.1407 1.71599 -0.942075 0.607329 0.570328 1.7286 2.44704 1 0.125372 +9.38516 -6.64145 -0.653333 0.911232 0.61952 1.90726 4.49685 1 0.120847 +56.7258 23.962 -1.25117 3.79062 1.66853 1.59126 3.32126 0 0.118333 +0.550931 37.3028 -0.579125 3.76523 1.63462 1.61213 1.55702 0 0.109261 +7.86305 2.20714 -0.844534 4.13259 1.75084 2.1171 4.77064 0 0.104109 +53.6537 21.3934 -1.23539 4.27381 1.57709 2.0426 3.14738 0 0.101018 diff --git a/data/box_prediction/result_000002.txt b/data/box_prediction/result_000002.txt new file mode 100644 index 0000000..0d27803 --- /dev/null +++ b/data/box_prediction/result_000002.txt @@ -0,0 +1,41 @@ +11.5366 -4.99615 -0.777808 4.50907 1.78234 1.66878 4.75727 0 0.92953 +6.09859 -5.10718 -0.785535 3.92117 1.7104 1.63828 4.77097 0 0.905589 +3.17567 -4.89119 -0.884924 3.65252 1.67349 1.55565 4.69271 0 0.824793 +20.645 6.20942 -1.29475 3.76695 1.58469 1.47828 3.18777 0 0.724809 +52.6124 -4.40996 -0.671718 4.14121 1.6408 1.57853 4.187 0 0.490087 +4.76965 -11.5987 -0.559729 0.681173 0.664236 1.71238 2.47891 1 0.489413 +26.3181 5.96076 -1.34553 3.97444 1.59442 1.51689 3.12127 0 0.406165 +12.7891 6.24153 -1.25135 1.83129 0.840271 1.54606 5.58326 2 0.389412 +11.2944 6.5093 -1.27092 1.82873 0.655739 1.58564 5.3344 2 0.317593 +15.8095 -21.7277 0.276633 0.480192 0.606431 1.81003 1.63467 1 0.295923 +30.6516 5.57602 -1.36541 1.61227 0.501321 1.67267 3.02723 2 0.290442 +28.1977 -6.2118 -0.586082 1.86837 0.624921 1.90563 1.08619 2 0.263243 +14.398 5.97983 -1.20236 1.77099 0.661443 1.67923 5.50258 2 0.24867 +25.6954 -13.6323 -0.120621 0.786005 0.662627 1.78445 3.56685 1 0.236496 +16.686 5.95105 -1.14465 1.74575 0.602241 1.77821 3.04647 2 0.232469 +61.8245 0.122785 -1.13373 4.07085 1.6787 1.50839 3.26092 0 0.226522 +17.0492 -13.3501 0.109086 0.785594 0.679411 1.75375 5.80252 1 0.225637 +9.04463 -13.0799 0.00277124 0.766049 0.587789 1.78541 1.51836 1 0.200912 +36.3508 -19.6957 0.224755 0.808838 0.651001 1.83465 5.5621 1 0.197926 +31.4719 -14.6677 0.0747596 0.73339 0.626811 1.82296 6.0794 1 0.19159 +32.1204 -14.0116 0.00288219 0.604811 0.669186 1.78687 2.08473 1 0.189526 +15.1789 -20.7647 0.0344933 0.448873 0.594979 1.61119 1.8838 1 0.189487 +25.7576 -25.9026 0.444149 0.722323 0.68638 1.74302 5.35789 1 0.188614 +17.1175 -22.2742 -0.000870072 0.601733 0.602848 1.67381 1.68169 1 0.172105 +32.0144 -15.2973 -0.016246 0.543824 0.64141 1.79796 1.97822 1 0.143674 +9.37057 -6.20674 -0.44847 0.880607 0.715713 1.98249 6.19613 1 0.137573 +14.6937 -5.03294 -0.871657 4.00179 1.59869 1.51346 4.96924 0 0.133894 +38.041 5.93105 -1.45424 4.11015 1.59948 1.47025 3.15261 0 0.130123 +19.2835 -6.23806 -0.576405 0.606785 0.637754 1.95325 3.0892 1 0.125735 +54.9418 -8.81467 -0.94609 4.35431 1.70094 1.52128 2.4741 0 0.115619 +25.0621 -28.4054 0.666862 0.531624 0.561413 1.71344 2.01672 1 0.112973 +0.912261 -6.49154 -0.838139 0.932267 0.520197 1.81009 1.16269 1 0.112118 +24.8251 -23.3401 0.0651318 0.572088 0.706166 1.67755 5.81532 1 0.111203 +34.6747 -16.6091 -0.514283 1.62494 0.366612 1.65305 6.57206 2 0.110142 +7.07984 -29.0281 0.306747 0.573166 0.662463 1.69868 5.22401 1 0.109639 +14.1402 -23.0638 0.0903649 0.599592 0.623819 1.6309 1.84077 1 0.108661 +6.75535 5.91079 -1.17158 0.831973 0.622517 1.79642 4.2092 1 0.107394 +12.201 -27.1703 0.252226 0.582358 0.701017 1.72717 5.56451 1 0.104931 +12.8556 -26.4568 0.177471 0.60098 0.619473 1.72127 1.35032 1 0.103998 +19.9798 -26.2874 0.25913 0.597818 0.639407 1.72132 2.00954 1 0.102792 +5.35278 -35.4878 0.527375 1.68625 0.51734 1.67929 5.91632 2 0.1023 diff --git a/data/box_prediction/result_000003.txt b/data/box_prediction/result_000003.txt new file mode 100644 index 0000000..718c58f --- /dev/null +++ b/data/box_prediction/result_000003.txt @@ -0,0 +1,9 @@ +18.7987 4.31626 -0.902809 4.5765 1.79197 1.60158 6.27329 0 0.932557 +5.92792 12.5752 -1.35973 3.70052 1.62678 1.41038 3.1402 0 0.925149 +33.2554 -0.515638 -0.840724 3.33562 1.67443 1.5469 6.2851 0 0.619198 +58.4348 2.41329 -0.335366 3.74871 1.62767 1.56723 6.20334 0 0.410746 +58.4978 -3.00701 -0.355897 3.97716 1.57164 1.62635 2.96124 0 0.406562 +20.0732 17.1541 -0.826667 4.02181 1.70946 1.76521 6.41357 0 0.339534 +19.7612 18.47 -0.821657 1.87288 0.507796 1.84824 3.59298 2 0.288143 +43.3115 10.8853 -0.938537 3.85465 1.64173 1.52161 4.59309 0 0.15398 +18.5219 18.5005 -0.900031 0.709107 0.672031 1.92182 3.48156 1 0.104464 diff --git a/data/box_prediction/result_000004.txt b/data/box_prediction/result_000004.txt new file mode 100644 index 0000000..fd6d2a7 --- /dev/null +++ b/data/box_prediction/result_000004.txt @@ -0,0 +1,41 @@ +26.7811 -5.25834 -0.606002 1.87059 0.44021 1.78208 5.68004 2 0.467027 +24.1605 -5.93834 -0.696486 1.71292 0.486025 1.6723 6.14539 2 0.332268 +27.2936 -7.92043 -0.665853 0.602085 0.670826 1.73922 6.53568 1 0.266844 +21.0957 -5.98017 -0.84305 0.8459 0.540295 1.48107 3.20034 1 0.261118 +9.32842 -19.4307 -1.06336 0.747979 0.666834 1.87217 2.72294 1 0.234336 +8.94889 -7.8988 -0.662208 0.565723 0.626915 1.77291 5.17148 1 0.226176 +6.09125 -6.24996 -0.784421 0.836538 0.587339 1.70201 5.17592 1 0.225795 +43.5224 8.55276 -0.756448 4.17866 1.68282 1.60851 5.91312 0 0.218821 +16.103 -5.96414 -0.704096 1.74129 0.505352 1.76135 6.12812 2 0.214493 +18.9776 -6.00978 -0.723079 1.80553 0.702948 1.69682 1.78155 2 0.206772 +2.57566 -5.65329 -0.638414 0.953867 0.644995 1.91107 1.49302 1 0.192759 +11.243 -6.17041 -0.751407 1.78655 0.647498 1.67368 0.990916 2 0.190002 +5.17992 -5.94706 -0.795402 0.892666 0.558416 1.69047 1.71481 1 0.187673 +3.55422 -6.34641 -0.855471 0.904803 0.586966 1.62682 2.1212 1 0.178388 +9.73687 -6.1731 -0.717262 0.702972 0.607618 1.72074 1.57873 1 0.174496 +3.88085 -19.4683 -0.916353 0.657851 0.619257 1.87969 2.5265 1 0.174318 +8.72241 -6.02619 -0.72883 0.851784 0.55691 1.75011 4.86054 1 0.172546 +4.22905 -6.18578 -0.799046 0.879963 0.610591 1.6854 1.64124 1 0.159912 +5.98342 14.6721 -0.00406886 5.31296 1.63453 2.62548 4.75992 0 0.144279 +15.8086 -17.4668 -0.870583 0.413668 0.779341 1.90855 5.8602 1 0.142345 +12.5413 -5.71568 -0.687138 0.757096 0.596303 1.77757 1.59543 1 0.141906 +16.9877 0.0768824 -0.799508 0.529522 0.50078 1.70252 1.08213 1 0.138791 +24.2129 -16.7977 -1.10248 1.59989 0.490169 1.73781 3.3737 2 0.137781 +1.29491 -5.94629 -0.841969 0.913088 0.605529 1.69177 4.98137 1 0.130493 +8.0782 -8.17888 -0.658273 0.956381 0.54734 1.77878 4.36426 1 0.128348 +17.2943 -6.19721 -0.815525 0.57036 0.677555 1.57722 4.03354 1 0.12819 +13.209 -5.93797 -0.74751 0.625407 0.6346 1.70598 5.4514 1 0.127949 +10.8459 -19.0885 -1.32086 0.637127 0.527263 1.58692 2.21159 1 0.12433 +8.98883 9.26507 -1.06303 0.653316 0.496522 1.5277 1.64948 1 0.119848 +31.6709 -17.8558 -1.27886 3.48085 1.59361 1.5415 6.34643 0 0.119616 +17.4412 8.85569 -1.0234 1.70973 0.580684 1.68051 6.29043 2 0.11856 +25.6554 -5.29481 -0.638993 0.72719 0.616564 1.71337 1.93068 1 0.118212 +13.5517 -8.24361 -0.680757 0.707582 0.597682 1.73621 2.66372 1 0.117271 +5.73008 -8.13214 -0.670763 0.893737 0.625255 1.79644 3.68301 1 0.117045 +8.05955 -6.9501 -0.72291 0.855232 0.569807 1.72109 1.77779 1 0.116015 +10.5801 -5.98967 -0.740359 0.622655 0.630035 1.71646 5.78744 1 0.109606 +36.0616 7.15531 -0.76616 1.81435 0.663929 1.85286 4.45977 2 0.109163 +39.3905 8.90628 -0.938885 3.63722 1.59059 1.52197 6.07947 0 0.102826 +14.7828 -5.93002 -0.799194 0.619777 0.596486 1.6893 5.33562 1 0.10253 +10.9994 9.08451 -1.02372 0.680039 0.691909 1.64827 3.31635 1 0.102379 +3.04849 8.52217 -0.998834 1.83324 0.78109 1.65517 6.49652 2 0.101448 diff --git a/data/box_prediction/result_000005.txt b/data/box_prediction/result_000005.txt new file mode 100644 index 0000000..908d68d --- /dev/null +++ b/data/box_prediction/result_000005.txt @@ -0,0 +1,41 @@ +8.7769 -2.98331 -0.814884 3.8834 1.69052 1.66925 6.30457 0 0.96396 +18.4999 -2.98055 -0.685071 3.78702 1.63496 1.62745 6.32895 0 0.92586 +4.86391 6.9185 -0.839032 4.38308 1.78705 1.78026 1.6012 0 0.921604 +13.6538 -2.96558 -0.674024 3.69112 1.64808 1.76042 6.38658 0 0.919069 +12.4735 6.92555 -0.765202 4.32977 1.68258 1.73607 4.71602 0 0.888331 +2.57435 -3.03333 -0.96045 3.88843 1.66236 1.61179 6.28657 0 0.842868 +23.4553 -3.06651 -0.617729 3.8057 1.64362 1.66312 6.36047 0 0.699073 +1.57582 7.17246 -0.793225 4.28703 1.74025 1.71842 4.77044 0 0.511047 +6.80113 -11.7267 -0.71394 0.787437 0.542384 1.49468 4.2796 1 0.352943 +12.8336 -7.14258 -0.563755 1.85826 0.729263 1.70139 1.12649 2 0.341814 +10.8131 -9.75378 -0.462355 1.76213 0.590263 1.73705 5.66579 2 0.337436 +8.70987 -11.1275 -0.540239 1.73495 0.589876 1.66286 1.82416 2 0.337011 +8.29682 -6.56264 -0.633723 0.814733 0.665196 1.74888 1.80369 1 0.317102 +14.7346 -9.53903 -0.495497 0.413182 0.524511 1.66495 2.05003 1 0.291467 +14.7341 -7.52833 -0.515657 0.546028 0.572036 1.73392 1.68271 1 0.262117 +6.66567 -10.512 -0.548852 0.73368 0.630636 1.65684 3.96849 1 0.258435 +1.85756 -8.22054 -0.692198 0.720582 0.618455 1.73144 2.1859 1 0.244766 +17.0364 -6.27915 -0.415468 1.79161 0.749481 1.93683 3.02626 2 0.24139 +13.3887 11.9882 -0.898659 1.66166 0.472664 1.63971 6.15949 2 0.239722 +5.79499 -11.0819 -0.579926 1.70012 0.598234 1.63719 1.7871 2 0.203813 +19.2227 6.31103 -0.675454 0.904899 0.676013 1.91408 1.90588 1 0.197407 +10.3363 -6.33175 -0.630773 0.798454 0.596412 1.72402 1.8506 1 0.193605 +9.56641 -6.92254 -0.561779 0.739595 0.683869 1.75638 5.91679 1 0.17253 +4.73974 -11.107 -0.602412 0.692257 0.592012 1.67019 3.48076 1 0.170883 +5.04982 -6.97205 -0.653997 0.881043 0.593001 1.82297 1.10281 1 0.155883 +1.78261 -11.087 -0.601669 0.717807 0.564339 1.70512 2.14366 1 0.154659 +19.0887 -6.81047 -0.379786 0.880866 0.642945 1.86368 2.47776 1 0.152811 +7.73644 -9.68005 -0.491467 1.76848 0.536786 1.81339 4.60996 2 0.144932 +1.2955 -7.14107 -0.797538 0.882882 0.579204 1.70546 4.38201 1 0.142196 +33.8469 16.3876 -1.11485 3.52036 1.46351 1.45642 4.62982 0 0.140103 +9.57281 -11.3312 -0.533452 0.763796 0.586273 1.64048 5.33648 1 0.139564 +11.5062 -6.33493 -0.670911 1.63865 0.498105 1.72469 6.12462 2 0.135235 +45.8948 -7.88328 -0.359724 0.350721 0.470118 1.79604 1.9946 1 0.135058 +18.3309 -6.27356 -0.298204 0.978034 0.652013 2.01428 1.35389 1 0.133194 +8.60437 6.27025 -0.786175 1.02343 0.574608 1.86206 2.11874 1 0.129794 +4.80084 -6.25214 -0.637992 0.857273 0.610668 1.84501 3.82198 1 0.120821 +9.87176 -10.4833 -0.46817 0.74951 0.593436 1.65463 2.95505 1 0.114728 +2.92163 -11.7867 -0.527281 0.863194 0.582961 1.79351 2.68461 1 0.114236 +17.7084 -35.1029 -0.564248 1.74952 0.74595 1.87694 4.38639 2 0.108269 +52.9948 19.9036 -0.809002 4.21221 1.64087 1.46973 2.30584 0 0.104453 +23.7726 -7.84328 -0.328302 0.621306 0.588083 1.89069 1.76524 1 0.101815 diff --git a/data/box_prediction/result_000006.txt b/data/box_prediction/result_000006.txt new file mode 100644 index 0000000..ec8aa66 --- /dev/null +++ b/data/box_prediction/result_000006.txt @@ -0,0 +1,28 @@ +4.43899 -13.5842 -0.462807 3.94171 1.53648 1.7555 6.24787 0 0.927031 +14.6748 -13.72 -0.334258 4.76257 1.85617 1.87429 6.29573 0 0.891708 +28.1945 0.749813 -0.737755 4.51096 1.83646 1.7327 6.37812 0 0.830576 +1.65815 -6.33887 -0.944179 0.773689 0.45972 1.4605 2.91703 1 0.268678 +13.7878 29.5647 -0.192023 5.09842 1.65402 2.69145 4.47024 0 0.199664 +2.69669 -15.2231 -0.464229 0.716372 0.632819 1.66943 2.19516 1 0.188421 +4.47653 -6.36497 -0.931669 0.640672 0.324716 1.27632 3.24762 1 0.186621 +5.81865 17.8266 -0.789435 3.58775 1.65098 1.88158 6.07198 0 0.179472 +28.3328 -15.9164 -0.092854 0.787139 0.620747 1.80173 2.59441 1 0.177683 +0.369309 16.5711 -0.624108 3.81078 1.71454 1.81683 3.2368 0 0.175235 +10.4398 26.8497 -0.327269 5.48566 1.72014 2.69118 4.65861 0 0.169089 +53.6308 3.72176 -0.298323 3.78817 1.76044 1.70035 6.36897 0 0.165861 +27.0417 -15.5781 -0.11137 0.882853 0.698984 1.88782 3.0676 1 0.157505 +19.5696 -15.001 -0.377873 0.641322 0.544311 1.84251 0.920072 1 0.156124 +8.05311 -15.2273 -0.391921 0.518473 0.603035 1.69674 1.33059 1 0.146697 +15.6907 -7.07804 -0.722869 1.53101 0.577334 1.60424 1.48021 2 0.142217 +7.40628 -6.25275 -0.623991 0.90151 0.480155 1.7975 1.09716 1 0.136709 +7.08668 19.7723 -0.881546 3.97095 1.59892 1.89512 5.91765 0 0.134296 +10.1922 -6.33554 -0.861253 0.484064 0.385154 1.28236 3.85642 1 0.133845 +20.669 27.4293 -0.794689 3.51 1.55493 1.88648 6.51433 0 0.133728 +29.8666 -14.5622 -0.283239 1.83943 0.759493 1.64945 4.29064 2 0.127207 +13.2744 -7.28821 -0.727841 0.516885 0.559082 1.4477 6.18353 1 0.125596 +23.8858 26.3522 -0.414499 5.02156 1.57486 2.69121 4.64024 0 0.116208 +31.068 -14.9235 -0.0741847 1.71357 0.417451 1.69209 6.00237 2 0.112251 +32.0909 32.3007 -0.81839 3.82392 1.75755 2.00597 4.64054 0 0.103317 +29.15 -16.2288 -0.0538325 0.523905 0.635148 1.81168 5.67094 1 0.102379 +38.2325 -14.3955 -0.00171781 0.645491 0.599345 1.77887 2.25409 1 0.101174 +48.6525 8.48183 -0.533477 3.74017 1.65909 2.0507 3.32196 0 0.100594 diff --git a/data/box_prediction/result_000007.txt b/data/box_prediction/result_000007.txt new file mode 100644 index 0000000..1e37050 --- /dev/null +++ b/data/box_prediction/result_000007.txt @@ -0,0 +1,33 @@ +12.9997 -4.33154 -0.82707 4.22399 1.7698 1.72928 6.1923 0 0.942978 +24.6511 -5.38836 -1.0746 4.43548 1.69945 1.4608 6.24447 0 0.927467 +12.5188 4.29417 -0.598923 1.07209 0.65182 1.92674 6.42916 1 0.654665 +42.7796 0.879545 -0.760507 0.692988 0.641256 1.82574 5.04829 1 0.409943 +39.7024 -4.05596 -1.025 4.45324 1.76157 1.58842 6.1157 0 0.377181 +27.7138 2.1508 -0.843839 0.724163 0.74433 1.89675 5.95235 1 0.336571 +22.4508 6.65277 -0.955042 3.7879 1.64036 1.52991 2.70191 0 0.327393 +6.38843 -17.9325 -0.681507 0.816418 0.609018 1.77879 2.09863 1 0.32401 +33.2261 -6.61904 -1.03394 3.64734 1.59203 1.49458 6.22889 0 0.30947 +4.8892 14.8903 -0.948367 3.96157 1.73481 1.70086 6.52059 0 0.285643 +11.1885 9.48078 -0.728066 1.7353 0.547089 1.70591 5.71823 2 0.251364 +43.3859 -21.0709 -0.691039 0.623943 0.69056 1.82734 4.39651 1 0.224448 +12.4641 10.0627 -0.691118 0.806305 0.618456 1.835 6.31101 1 0.223244 +12.8722 -14.9621 -0.853408 1.65689 0.419711 1.60789 6.27428 2 0.210468 +24.0322 3.15315 -0.792554 0.919809 0.636872 1.87132 2.89877 1 0.209688 +19.3435 5.28675 -0.883385 1.75301 0.674117 1.63058 5.28565 2 0.206663 +14.1087 13.3632 -1.16979 3.33086 1.58045 1.48556 6.76592 0 0.205627 +25.0028 2.95564 -0.897087 0.697745 0.521601 1.7628 0.803971 1 0.195379 +3.28734 -40.4133 -1.91758 3.93482 1.64477 1.54632 1.2381 0 0.189177 +20.6438 -14.6124 -1.04738 1.56995 0.346607 1.57072 6.16361 2 0.18337 +11.5028 -25.8489 -0.469562 0.261103 0.537379 1.78187 5.3696 1 0.17018 +34.5982 6.31027 -0.980628 3.99893 1.57385 1.59166 3.4041 0 0.159671 +13.8538 14.6378 -1.14225 1.80761 0.609598 1.69392 6.41338 2 0.157988 +22.7197 1.22207 -0.927115 0.810231 0.623334 1.71194 3.20029 1 0.152585 +6.55308 9.75563 -0.708983 0.894521 0.634455 1.69347 3.71823 1 0.150354 +30.9119 2.83817 -0.818048 0.811062 0.646168 1.94758 1.81893 1 0.146616 +27.0226 -18.4498 -0.865365 0.340712 0.558792 1.89447 7.0655 1 0.131607 +12.1361 -35.9424 -0.180971 0.755144 0.698685 1.85488 2.12957 1 0.129625 +5.46692 -16.9144 -0.656672 0.880922 0.606346 1.81065 2.19432 1 0.121206 +13.8081 22.6194 -0.559222 3.96557 1.65233 1.64222 5.85358 0 0.117699 +4.5014 -31.6384 -0.277035 0.63775 0.675634 1.91577 2.32929 1 0.116771 +29.0345 27.5084 -0.62045 1.76048 0.693177 1.83349 1.81851 2 0.115252 +30.5965 0.0959285 -0.742659 0.846749 0.617027 1.91313 2.76442 1 0.115176 diff --git a/data/box_prediction/result_000008.txt b/data/box_prediction/result_000008.txt new file mode 100644 index 0000000..6d4738b --- /dev/null +++ b/data/box_prediction/result_000008.txt @@ -0,0 +1,38 @@ +5.31793 -6.66751 -0.733259 3.89394 1.68707 1.5283 4.89396 0 0.921447 +23.8596 -1.34423 -0.821128 3.94587 1.7211 1.57324 6.40431 0 0.915028 +20.3895 13.665 -0.971977 4.03984 1.64685 1.82322 3.22751 0 0.752854 +20.9189 -4.89464 -0.65781 0.835868 0.585801 1.68423 4.30457 1 0.536714 +6.62951 -12.0728 -0.56281 4.28338 1.70162 1.77293 4.97006 0 0.484992 +18.9534 -24.9595 -0.0805587 3.76427 1.63434 1.6305 6.98027 0 0.464873 +48.6406 0.0819468 -0.861649 3.93097 1.67657 1.67022 6.31954 0 0.45183 +27.6155 6.07559 -0.667088 0.836167 0.640313 1.98019 3.38988 1 0.447769 +25.0161 7.48982 -0.854369 0.945154 0.639868 1.82791 6.66266 1 0.418739 +26.2163 14.0951 -0.95663 4.31722 1.70587 1.84691 6.32754 0 0.30569 +26.842 -14.6416 0.378891 1.76113 0.558236 1.82859 5.71396 2 0.297378 +8.75451 -20.9589 -0.108268 4.0874 1.68431 1.6617 4.96748 0 0.288037 +18.3946 4.75775 -0.91194 1.7253 0.600054 1.65706 4.49324 2 0.280827 +19.4062 -6.50456 -0.593387 0.784483 0.583948 1.6821 2.27778 1 0.227682 +18.0116 -22.1289 0.0450496 0.31594 0.473067 1.88437 1.06756 1 0.221392 +17.7166 5.97777 -0.920529 0.886256 0.629312 1.72199 1.05316 1 0.213717 +42.7586 6.57306 -0.96549 1.74169 0.512913 1.74905 6.01574 2 0.201765 +17.7372 -29.0458 0.128122 0.552011 0.764337 1.77702 5.89077 1 0.198931 +20.1675 -8.89843 -0.556944 0.789674 0.606887 1.68681 6.33824 1 0.187087 +28.6085 15.0189 -0.8533 0.591593 0.560734 1.90977 6.65138 1 0.180495 +23.5453 6.96372 -0.917609 1.69908 0.460751 1.72492 5.90439 2 0.163146 +20.6232 7.66323 -0.687838 1.00495 0.663446 2.01572 3.70044 1 0.161335 +15.9284 41.017 -1.29409 4.21846 1.67255 1.63007 3.78609 0 0.157094 +26.882 5.59193 -0.802584 0.79384 0.628415 1.82068 2.70541 1 0.155037 +5.48171 40.1244 -0.760348 4.61214 1.80666 1.83681 1.47731 0 0.136999 +15.5224 13.0329 -1.34875 0.510941 0.38402 1.21803 3.6 1 0.135882 +13.3387 37.9497 -0.0161947 2.13898 0.844133 2.76692 5.73315 2 0.129346 +25.4034 -31.7328 0.86779 1.55024 0.449482 1.67505 2.74941 2 0.127221 +20.2201 -34.8174 0.191436 3.67814 1.59944 1.53215 7.0253 0 0.123731 +11.6422 40.009 -0.692812 4.61753 1.84391 2.1138 1.14095 0 0.121529 +10.3773 19.7956 -0.758371 4.43588 1.77475 2.13845 1.05048 0 0.121344 +25.03 -32.6525 0.809513 1.70036 0.655838 1.73163 4.89521 2 0.113734 +5.34363 30.2945 -0.603042 4.48165 1.52856 2.41317 4.28416 0 0.113086 +20.56 -6.25317 -0.699084 0.744666 0.555015 1.6308 2.18245 1 0.111557 +22.7369 -21.0375 0.111123 0.719689 0.63618 1.80007 2.92425 1 0.111247 +23.9814 -25.4767 0.109387 0.594352 0.602381 1.78585 2.82901 1 0.108641 +22.4925 -15.6112 -0.0697218 0.461882 0.503593 1.77682 1.33595 1 0.103643 +18.021 7.23892 -1.08137 1.73203 0.586441 1.64063 1.21031 2 0.100645 diff --git a/data/box_prediction/result_000009.txt b/data/box_prediction/result_000009.txt new file mode 100644 index 0000000..fb9840c --- /dev/null +++ b/data/box_prediction/result_000009.txt @@ -0,0 +1,60 @@ +8.78866 -2.34409 -0.637382 1.05901 0.64746 1.92712 1.8745 1 0.55748 +2.64861 3.18071 -0.810938 0.940434 0.704153 1.89314 3.67545 1 0.484114 +16.0417 17.4968 -0.778198 0.637347 0.574125 1.58008 1.28703 1 0.47093 +2.22769 5.4157 -0.675758 0.910515 0.656953 1.98823 1.94892 1 0.454269 +3.41294 5.85833 -0.680198 0.948512 0.565562 1.86402 3.33364 1 0.413972 +6.32261 -3.41041 -1.0482 0.687891 0.389741 1.27143 3.07308 1 0.409094 +15.4784 14.8603 -0.675436 0.815656 0.554144 1.64569 3.58427 1 0.360185 +9.0151 -8.91111 -0.65516 1.69354 0.439183 1.70602 6.00618 2 0.35644 +3.88762 4.75056 -0.710581 0.823935 0.574927 1.93756 2.12218 1 0.345359 +21.182 -20.067 -0.322046 0.430236 0.545299 1.89644 6.86867 1 0.325011 +8.86559 14.2758 -0.647639 3.51077 1.61524 1.63508 1.48323 0 0.305832 +24.2734 -22.9386 -0.19137 0.469813 0.567276 1.82432 4.48313 1 0.290424 +4.8244 16.3147 -0.561941 1.02448 0.603547 1.86721 2.25383 1 0.280253 +13.246 -8.37451 -0.713664 1.81465 0.654514 1.67227 1.18069 2 0.276232 +15.7784 8.46961 -0.632195 0.819814 0.643355 1.69697 2.82093 1 0.250659 +7.68854 -6.27073 -0.817989 1.78842 0.544773 1.57249 5.26693 2 0.242883 +16.3983 -2.09384 -0.785426 1.66223 0.585736 1.57777 1.08266 2 0.228316 +16.3351 12.4663 -0.566146 0.954736 0.583836 1.76515 6.76456 1 0.20757 +1.63236 -4.01819 -0.906418 0.897405 0.64623 1.73202 4.3482 1 0.206994 +0.984784 13.9805 -0.602934 0.792423 0.59126 1.76688 4.90747 1 0.203387 +14.7445 -0.923975 -0.670416 0.878853 0.584521 1.75463 4.37928 1 0.191752 +14.8123 2.05842 -0.602806 1.76191 0.744359 1.79792 6.34866 2 0.191082 +2.4236 11.6769 -0.668247 1.8009 0.650215 1.66487 5.73621 2 0.190818 +3.50428 16.5415 -0.578463 0.855036 0.578843 1.76688 3.11221 1 0.188872 +20.0453 -6.83539 -0.7937 0.746568 0.568229 1.57712 6.17006 1 0.169668 +20.2423 -3.68201 -0.627372 1.77628 0.631517 1.73003 4.72193 2 0.169516 +5.10013 -4.67781 -0.959979 0.706871 0.620712 1.45647 4.70252 1 0.168621 +22.9124 16.914 -0.765465 0.89245 0.656022 1.65233 3.30024 1 0.167782 +16.6219 -0.104988 -0.821523 0.792307 0.516237 1.55329 3.88143 1 0.166659 +16.1256 -3.46269 -0.749046 0.81992 0.566655 1.69339 5.86761 1 0.162209 +13.4436 -6.62757 -0.714465 0.834952 0.56706 1.73362 1.86772 1 0.160367 +15.08 10.1371 -0.565826 0.858578 0.635043 1.69688 2.94791 1 0.151598 +1.93143 14.9371 -0.688617 1.74051 0.660587 1.50158 6.07922 2 0.151551 +14.1277 -3.36296 -0.747929 0.834663 0.586181 1.70221 2.11367 1 0.150557 +9.27518 -12.97 -0.685308 0.629603 0.611848 1.74645 1.46919 1 0.149452 +12.7158 5.69279 -0.796448 1.59609 0.556611 1.51302 3.07109 2 0.14745 +15.8033 -5.03242 -0.839315 0.746958 0.474655 1.56313 4.22075 1 0.146306 +7.41234 15.91 -0.661047 0.92493 0.545585 1.72359 4.66653 1 0.144587 +20.2501 -18.5507 -0.245826 0.449937 0.669164 1.97049 2.72928 1 0.142249 +15.431 16.231 -0.597571 0.90476 0.541635 1.76339 3.91652 1 0.14095 +24.8186 24.9459 -0.711831 0.631356 0.638512 1.76732 6.87139 1 0.138549 +19.9324 0.0961298 -0.534938 0.865943 0.630837 1.82097 6.66346 1 0.138462 +19.946 1.11724 -0.541999 0.822224 0.62592 1.79235 3.37172 1 0.138197 +4.95992 -7.82049 -0.962928 0.575699 0.57985 1.63625 5.83938 1 0.136794 +14.3799 -4.98008 -0.649011 0.729918 0.609387 1.81368 2.90451 1 0.135682 +15.6371 6.93953 -0.526894 0.961114 0.54621 1.80955 6.80803 1 0.132316 +13.5563 -4.96771 -0.844837 0.699632 0.607055 1.59889 2.44902 1 0.130425 +30.2191 30.2066 -0.675922 3.9388 1.54712 1.42703 0.897135 0 0.129127 +16.9959 15.0186 -0.620719 0.901381 0.599421 1.69817 1.39514 1 0.126611 +6.16454 -7.82094 -0.679111 0.822214 0.633953 1.88425 2.9309 1 0.126482 +15.4436 7.51066 -0.607402 0.810218 0.601797 1.71172 3.74462 1 0.125571 +12.5164 -11.0098 -0.625444 0.908728 0.511289 1.82437 0.993782 1 0.124211 +0.125626 -1.82348 -0.948426 3.86767 1.67715 1.60141 3.5919 0 0.120199 +5.4121 15.5829 -0.633101 0.85488 0.61725 1.79924 4.60466 1 0.117789 +4.0155 -5.02124 -0.931489 0.74148 0.702979 1.53736 5.80607 1 0.116836 +16.9962 3.02406 -0.820711 0.851151 0.496925 1.58666 3.94944 1 0.113492 +15.0749 9.17028 -0.605525 0.814428 0.6086 1.7194 3.01948 1 0.113383 +13.7992 -4.04708 -0.758719 0.674999 0.627115 1.6893 4.00051 1 0.110587 +16.069 13.1494 -0.599261 0.785232 0.654432 1.73669 4.33406 1 0.104837 +6.98607 15.2309 -0.521127 0.933095 0.589082 1.78591 1.99825 1 0.100175 diff --git a/test/main.cpp b/test/main.cpp index f119721..3e85d11 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -39,6 +39,33 @@ std::string Data_File = "../../data/"; std::string Model_File = "../../model/pointpillar.onnx"; +std::string Save_Dir = Data_File + "box_prediction/"; + +void SaveBoxPred(std::vector boxes, std::string file_name) +{ + std::ofstream ofs; + ofs.open(file_name, std::ios::out); + if (ofs.is_open()) { + for (const auto box : boxes) { + ofs << box.x << " "; + ofs << box.y << " "; + ofs << box.z << " "; + ofs << box.w << " "; + ofs << box.l << " "; + ofs << box.h << " "; + ofs << box.rt << " "; + ofs << box.id << " "; + ofs << box.score << " "; + ofs << "\n"; + } + } + else { + std::cerr << "Output file cannot be opened!" << std::endl; + } + ofs.close(); + std::cout << "Saved prediction in: " << file_name << std::endl; + return; +}; void Getinfo(void) { @@ -159,6 +186,8 @@ int main(int argc, const char **argv) checkCudaErrors(cudaFree(points_data)); std::cout<<"Bndbox objs: "<< nms_pred.size()<>>>>>>>>>>" < 0.3][:, :7] # score thr = 0.3 + draw_clouds_with_boxes(cloud, boxes) diff --git a/visualize/visual_tools/__init__.py b/visualize/visual_tools/__init__.py new file mode 100755 index 0000000..fd464cc --- /dev/null +++ b/visualize/visual_tools/__init__.py @@ -0,0 +1,75 @@ +import open3d as o3d +import numpy as np + + +from .open3d_coordinate import create_coordinate +from .open3d_arrow import create_arrow +from .open3d_box import create_box + + +def create_box_with_arrow(box, color=None): + """ + box: list(8) [ x, y, z, dx, dy, dz, yaw] + """ + + box_o3d = create_box(box, color) + x = box[0] + y = box[1] + z = box[2] + l = box[3] + yaw = box[6] + # get direction arrow + dir_x = l / 2.0 * np.cos(yaw) + dir_y = l / 2.0 * np.sin(yaw) + + arrow_origin = [x - dir_x, y - dir_y, z] + arrow_end = [x + dir_x, y + dir_y, z] + arrow = create_arrow(arrow_origin, arrow_end, color) + + return box_o3d, arrow + + +def draw_clouds_with_boxes(cloud , boxes): + """ + cloud: (N, 4) [x, y, z, intensity] + boxes: (n,7) np.array = n*7 ( x, y, z, dx, dy, dz, yaw) + """ + vis = o3d.visualization.Visualizer() + vis.create_window() + # -------------------------------------------------------------- + # create point cloud + # -------------------------------------------------------------- + points_color = [[0.5, 0.5, 0.5]] * cloud.shape[0] + # print(np.unique(cloud[:, 3])) + pc = o3d.geometry.PointCloud() + pc.points = o3d.utility.Vector3dVector(cloud[:,:3]) + pc.colors = o3d.utility.Vector3dVector(points_color) + vis.add_geometry(pc) + + # -------------------------------------------------------------- + # create boxes with colors with arrow + # -------------------------------------------------------------- + boxes_o3d = [] + + cur_box_color = [1, 0, 0] + + # create boxes + for box in boxes: + box_o3d, arrow = create_box_with_arrow(box, cur_box_color) + boxes_o3d.append(box_o3d) + boxes_o3d.append(arrow) + # add_geometry fro boxes + [vis.add_geometry(element) for element in boxes_o3d] + + # -------------------------------------------------------------- + # coordinate frame + # -------------------------------------------------------------- + coordinate_frame = create_coordinate(size=2.0, origin=[0, 0, 0]) + vis.add_geometry(coordinate_frame) + + # -------------------------------------------------------------- + # drop the window + # -------------------------------------------------------------- + vis.get_render_option().point_size = 2 + vis.run() + vis.destroy_window() diff --git a/visualize/visual_tools/open3d_arrow.py b/visualize/visual_tools/open3d_arrow.py new file mode 100755 index 0000000..7ae4b70 --- /dev/null +++ b/visualize/visual_tools/open3d_arrow.py @@ -0,0 +1,125 @@ +import open3d as o3d +import numpy as np + + +# def draw_geometries(pcds): +# """ +# Draw Geometries +# Args: +# - pcds (): [pcd1,pcd2,...] +# """ +# o3d.visualization.draw_geometries(pcds) + + +# def get_o3d_FOR(origin=[0, 0, 0], size=10): +# """ +# Create a FOR that can be added to the open3d point cloud +# """ +# mesh_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=size) +# mesh_frame.translate(origin) +# return mesh_frame + + +def vector_magnitude(vec): + """ + Calculates a vector's magnitude. + Args: + - vec (): + """ + magnitude = np.sqrt(np.sum(vec ** 2)) + return magnitude + + +def calculate_zy_rotation_for_arrow(vec): + """ + Calculates the rotations required to go from the vector vec to the + z axis vector of the original FOR. The first rotation that is + calculated is over the z axis. This will leave the vector vec on the + XZ plane. Then, the rotation over the y axis. + + Returns the angles of rotation over axis z and y required to + get the vector vec into the same orientation as axis z + of the original FOR + + Args: + - vec (): + """ + # Rotation over z axis of the FOR + gamma = np.arctan(vec[1] / vec[0]) + Rz = np.array( + [ + [np.cos(gamma), -np.sin(gamma), 0], + [np.sin(gamma), np.cos(gamma), 0], + [0, 0, 1], + ] + ) + # Rotate vec to calculate next rotation + vec = Rz.T @ vec.reshape(-1, 1) + vec = vec.reshape(-1) + # Rotation over y axis of the FOR + beta = np.arctan(vec[0] / (vec[2] + 1e-8)) + Ry = np.array( + [[np.cos(beta), 0, np.sin(beta)], [0, 1, 0], [-np.sin(beta), 0, np.cos(beta)]] + ) + return (Rz, Ry) + + +def get_arrow(scale=10): + """ + Create an arrow in for Open3D + """ + cone_height = scale * 0.2 + cylinder_height = scale * 0.8 + cone_radius = scale / 10 + cylinder_radius = scale / 20 + mesh_frame = o3d.geometry.TriangleMesh.create_arrow( + cone_radius=0.5, + cone_height=cone_height, + cylinder_radius=0.25, + cylinder_height=cylinder_height, + ) + return mesh_frame + + +def create_arrow(origin=[0, 0, 0], end=None, color=[1, 0, 0], vec=None): + """ + Creates an arrow from an origin point to an end point, + or create an arrow from a vector vec starting from origin. + Args: + - end (): End point. [x,y,z] + - vec (): Vector. [i,j,k] + """ + scale = 10 + Ry = Rz = np.eye(3) + T = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) + T[:3, -1] = origin + if end is not None: + vec = np.array(end) - np.array(origin) + elif vec is not None: + vec = np.array(vec) + if end is not None or vec is not None: + scale = vector_magnitude(vec) + Rz, Ry = calculate_zy_rotation_for_arrow(vec) + mesh = get_arrow(scale) + # Create the arrow + mesh.rotate(Ry, center=np.array([0, 0, 0])) + mesh.rotate(Rz, center=np.array([0, 0, 0])) + mesh.translate(origin) + + mesh.paint_uniform_color(color) + return mesh + + +# # Create a Cartesian Frame of Reference +# FOR = get_o3d_FOR() +# # Create an arrow from point (5,5,5) to point (10,10,10) +# arrow = get_arrow([5,5,5],[10,10,10]) + +# # Create an arrow representing vector vec, starting at (5,5,5) +# # arrow = get_arrow([5,5,5],vec=[5,5,5]) + +# # Create an arrow in the same place as the z axis +# # arrow = get_arrow() + +# # Draw everything +# draw_geometries([FOR,arrow]) diff --git a/visualize/visual_tools/open3d_box.py b/visualize/visual_tools/open3d_box.py new file mode 100755 index 0000000..09071f4 --- /dev/null +++ b/visualize/visual_tools/open3d_box.py @@ -0,0 +1,105 @@ +import numpy as np +import open3d as o3d + + +def rotz(t): + """ Rotation about the z-axis. """ + c = np.cos(t) + s = np.sin(t) + return np.array([[c, -s, 0], [s, c, 0], [0, 0, 1]]) + + +def box2corners(box): + """ + box: [x, y, z, dx, dy, dz, yaw] + """ + + # 8 corners: np.array = n*8*3(x, y, z) + # 7 -------- 6 + # /| /| + # 4 -------- 5 . + # | | | | + # . 3 -------- 2 + # |/ |/ + # 0 -------- 1 + + # ^ dx(l) + # | + # | + # | + # dy(w) | + # <-----------O + + x = box[0] + y = box[1] + z = box[2] + + l = box[3] # dx + w = box[4] # dy + h = box[5] # dz + + yaw = box[6] + + # 3d bounding box corners + Box = np.array( + [ + [-l / 2, -l / 2, l / 2, l / 2, -l / 2, -l / 2, l / 2, l / 2], + [w / 2, -w / 2, -w / 2, w / 2, w / 2, -w / 2, -w / 2, w / 2], + [-h / 2, -h / 2, -h / 2, -h / 2, h / 2, h / 2, h / 2, h / 2], + ] + ) + + R = rotz(yaw) + corners_3d = np.dot(R, Box) # corners_3d: (3, 8) + + corners_3d[0, :] = corners_3d[0, :] + x + corners_3d[1, :] = corners_3d[1, :] + y + corners_3d[2, :] = corners_3d[2, :] + z + + return np.transpose(corners_3d) + + +def create_box_from_corners(corners, color=None): + """ + corners: 8 corners(x, y, z) + corners: array = 8*3 + # 7 -------- 6 + # /| /| + # 4 -------- 5 . + # | | | | + # . 3 -------- 2 + # |/ |/ + # 0 -------- 1 + """ + # 12 lines in a box + lines = [ + [0, 1], + [1, 2], + [2, 3], + [3, 0], + [4, 5], + [5, 6], + [6, 7], + [7, 4], + [0, 4], + [1, 5], + [2, 6], + [3, 7], + ] + + colors = [color for i in range(len(lines))] + line_set = o3d.geometry.LineSet() + line_set.points = o3d.utility.Vector3dVector(corners) + line_set.lines = o3d.utility.Vector2iVector(lines) + line_set.colors = o3d.utility.Vector3dVector(colors) + + return line_set + + +def create_box(box, color=None): + """ + box: list(8) [ x, y, z, dx, dy, dz, yaw] + """ + box_corners = box2corners(box) + box = create_box_from_corners(box_corners, color) + return box diff --git a/visualize/visual_tools/open3d_coordinate.py b/visualize/visual_tools/open3d_coordinate.py new file mode 100755 index 0000000..70af385 --- /dev/null +++ b/visualize/visual_tools/open3d_coordinate.py @@ -0,0 +1,8 @@ +import open3d as o3d + + +def create_coordinate(size=2.0, origin=[0, 0, 0]): + mesh_frame = o3d.geometry.TriangleMesh.create_coordinate_frame( + size=2.0, origin=[0, 0, 0] + ) + return mesh_frame