dnt 0.2.4__tar.gz → 0.3.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dnt might be problematic. Click here for more details.

Files changed (338) hide show
  1. dnt-0.3.1.3/MANIFEST.in +6 -0
  2. {dnt-0.2.4/dnt.egg-info → dnt-0.3.1.3}/PKG-INFO +28 -10
  3. {dnt-0.2.4 → dnt-0.3.1.3}/README.md +6 -1
  4. dnt-0.3.1.3/dnt/__init__.py +5 -0
  5. dnt-0.3.1.3/dnt/analysis/__init__.py +8 -0
  6. dnt-0.3.1.3/dnt/analysis/interaction.py +503 -0
  7. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/analysis/speed.py +0 -0
  8. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/analysis/stop.py +22 -17
  9. dnt-0.3.1.3/dnt/analysis/stop2.py +289 -0
  10. dnt-0.3.1.3/dnt/analysis/stop3.py +754 -0
  11. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/detect/__init__.py +0 -0
  12. dnt-0.3.1.3/dnt/detect/signal/detector.py +317 -0
  13. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/detect/yolov8/__init__.py +0 -0
  14. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/detect/yolov8/detector.py +116 -16
  15. dnt-0.3.1.3/dnt/engine/__init__.py +8 -0
  16. dnt-0.3.1.3/dnt/engine/bbox_interp.py +83 -0
  17. dnt-0.3.1.3/dnt/engine/bbox_iou.py +20 -0
  18. dnt-0.3.1.3/dnt/engine/cluster.py +31 -0
  19. dnt-0.3.1.3/dnt/engine/iob.py +66 -0
  20. dnt-0.3.1.3/dnt/filter/filter.py +455 -0
  21. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/label/__init__.py +0 -0
  22. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/label/labeler.py +4 -4
  23. dnt-0.3.1.3/dnt/label/labeler2.py +502 -0
  24. {dnt-0.2.4/dnt/analysis → dnt-0.3.1.3/dnt/shared}/__init__.py +1 -3
  25. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/convert.py +0 -0
  26. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/data/coco.names +0 -0
  27. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/data/openimages.names +0 -0
  28. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/data/voc.names +0 -0
  29. dnt-0.3.1.3/dnt/shared/download.py +12 -0
  30. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/files.py +0 -0
  31. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/filter.py +0 -0
  32. dnt-0.3.1.3/dnt/shared/synhcro.py +150 -0
  33. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/shared/util.py +17 -4
  34. dnt-0.3.1.3/dnt/third_party/fast-reid/__init__.py +1 -0
  35. {dnt-0.2.4/dnt/track/dsort/deep_sort/deep → dnt-0.3.1.3/dnt/third_party/fast-reid/checkpoint}/__init__.py +0 -0
  36. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
  37. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
  38. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
  39. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
  40. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
  41. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
  42. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
  43. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
  44. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
  45. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
  46. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
  47. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
  48. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
  49. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
  50. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
  51. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
  52. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
  53. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
  54. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
  55. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
  56. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
  57. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
  58. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
  59. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
  60. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
  61. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
  62. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
  63. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
  64. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
  65. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
  66. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
  67. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
  68. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
  69. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
  70. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
  71. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
  72. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
  73. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
  74. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
  75. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
  76. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
  77. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
  78. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
  79. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
  80. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
  81. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
  82. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
  83. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
  84. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
  85. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
  86. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
  87. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
  88. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
  89. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
  90. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
  91. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
  92. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
  93. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
  94. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
  95. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
  96. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
  97. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
  98. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
  99. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
  100. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
  101. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
  102. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
  103. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
  104. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
  105. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
  106. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
  107. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
  108. dnt-0.3.1.3/dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
  109. {dnt-0.2.4/dnt/track/dsort/deep_sort/sort → dnt-0.3.1.3/dnt/third_party/fast-reid/configs}/__init__.py +0 -0
  110. dnt-0.3.1.3/dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
  111. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
  112. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
  113. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
  114. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
  115. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
  116. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
  117. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
  118. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
  119. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
  120. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
  121. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
  122. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
  123. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
  124. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
  125. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
  126. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
  127. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
  128. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
  129. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
  130. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
  131. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
  132. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
  133. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
  134. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
  135. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
  136. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
  137. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
  138. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
  139. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
  140. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
  141. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
  142. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
  143. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
  144. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
  145. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
  146. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
  147. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
  148. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
  149. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
  150. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
  151. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
  152. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
  153. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
  154. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
  155. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
  156. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
  157. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
  158. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
  159. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
  160. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
  161. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
  162. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
  163. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
  164. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
  165. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
  166. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
  167. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
  168. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
  169. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
  170. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
  171. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
  172. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
  173. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
  174. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
  175. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
  176. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
  177. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
  178. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
  179. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
  180. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
  181. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
  182. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
  183. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
  184. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
  185. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
  186. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
  187. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
  188. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
  189. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
  190. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
  191. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
  192. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
  193. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
  194. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
  195. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
  196. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
  197. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
  198. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
  199. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
  200. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
  201. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
  202. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
  203. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
  204. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
  205. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
  206. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
  207. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
  208. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
  209. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
  210. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
  211. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
  212. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
  213. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
  214. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
  215. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
  216. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
  217. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
  218. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
  219. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
  220. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
  221. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
  222. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
  223. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
  224. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
  225. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
  226. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
  227. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
  228. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
  229. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
  230. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
  231. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
  232. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
  233. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
  234. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
  235. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
  236. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
  237. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
  238. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
  239. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
  240. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
  241. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
  242. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
  243. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
  244. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
  245. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
  246. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
  247. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
  248. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
  249. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
  250. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
  251. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
  252. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
  253. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
  254. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
  255. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
  256. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
  257. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
  258. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
  259. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
  260. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
  261. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
  262. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
  263. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
  264. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
  265. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
  266. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
  267. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
  268. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
  269. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
  270. dnt-0.3.1.3/dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
  271. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/__init__.py +2 -0
  272. {dnt-0.2.4/dnt → dnt-0.3.1.3/dnt/track/botsort}/__init__.py +1 -1
  273. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/__init__.py +3 -0
  274. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/basetrack.py +60 -0
  275. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
  276. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/gmc.py +316 -0
  277. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
  278. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/matching.py +194 -0
  279. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
  280. {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.3/dnt/track/botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
  281. {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.3/dnt/track/botsort/bot_tracker/tracking_utils}/io.py +19 -36
  282. dnt-0.3.1.3/dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
  283. dnt-0.3.1.3/dnt/track/botsort/inference.py +96 -0
  284. dnt-0.3.1.3/dnt/track/config.py +120 -0
  285. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/__init__.py +0 -0
  286. dnt-0.3.1.3/dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
  287. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/configs/deep_sort.yaml +0 -0
  288. dnt-0.3.1.3/dnt/track/dsort/configs/fastreid.yaml +3 -0
  289. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/__init__.py +0 -0
  290. {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.3/dnt/track/dsort/deep_sort/deep}/__init__.py +0 -0
  291. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
  292. dnt-0.3.1.3/dnt/track/dsort/deep_sort/deep/feature_extractor.py +134 -0
  293. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/deep/model.py +0 -0
  294. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/deep_sort.py +28 -18
  295. dnt-0.3.1.3/dnt/track/dsort/deep_sort/sort/__init__.py +0 -0
  296. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/detection.py +0 -0
  297. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
  298. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/kalman_filter.py +0 -0
  299. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
  300. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
  301. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
  302. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/track.py +0 -0
  303. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/deep_sort/sort/tracker.py +0 -0
  304. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/dsort/dsort.py +21 -28
  305. dnt-0.3.1.3/dnt/track/re_class.py +94 -0
  306. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/sort/__init__.py +0 -0
  307. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/track/sort/sort.py +5 -1
  308. dnt-0.3.1.3/dnt/track/tracker.py +257 -0
  309. {dnt-0.2.4 → dnt-0.3.1.3/dnt.egg-info}/PKG-INFO +28 -10
  310. dnt-0.3.1.3/dnt.egg-info/SOURCES.txt +318 -0
  311. {dnt-0.2.4 → dnt-0.3.1.3}/dnt.egg-info/requires.txt +27 -9
  312. {dnt-0.2.4 → dnt-0.3.1.3}/setup.py +29 -11
  313. dnt-0.2.4/MANIFEST.in +0 -4
  314. dnt-0.2.4/dnt/analysis/yield.py +0 -9
  315. dnt-0.2.4/dnt/filter/filter.py +0 -135
  316. dnt-0.2.4/dnt/shared/__init__.py +0 -4
  317. dnt-0.2.4/dnt/track/dsort/configs/fastreid.yaml +0 -3
  318. dnt-0.2.4/dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
  319. dnt-0.2.4/dnt/track/dsort/deep_sort/deep/feature_extractor.py +0 -55
  320. dnt-0.2.4/dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
  321. dnt-0.2.4/dnt/track/dsort/deep_sort/deep/test.py +0 -77
  322. dnt-0.2.4/dnt/track/dsort/deep_sort/deep/train.py +0 -189
  323. dnt-0.2.4/dnt/track/dsort/utils/asserts.py +0 -13
  324. dnt-0.2.4/dnt/track/dsort/utils/draw.py +0 -36
  325. dnt-0.2.4/dnt/track/dsort/utils/json_logger.py +0 -383
  326. dnt-0.2.4/dnt/track/dsort/utils/log.py +0 -17
  327. dnt-0.2.4/dnt/track/dsort/utils/parser.py +0 -35
  328. dnt-0.2.4/dnt/track/dsort/utils/tools.py +0 -39
  329. dnt-0.2.4/dnt/track/tracker.py +0 -80
  330. dnt-0.2.4/dnt.egg-info/SOURCES.txt +0 -68
  331. {dnt-0.2.4 → dnt-0.3.1.3}/LICENSE +0 -0
  332. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/analysis/count.py +0 -0
  333. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/analysis/position.py +0 -0
  334. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/detect/yolov8/segmentor.py +0 -0
  335. {dnt-0.2.4 → dnt-0.3.1.3}/dnt/filter/__init__.py +0 -0
  336. {dnt-0.2.4 → dnt-0.3.1.3}/dnt.egg-info/dependency_links.txt +0 -0
  337. {dnt-0.2.4 → dnt-0.3.1.3}/dnt.egg-info/top_level.txt +0 -0
  338. {dnt-0.2.4 → dnt-0.3.1.3}/setup.cfg +0 -0
@@ -0,0 +1,6 @@
1
+ recursive-include dnt *.py
2
+ recursive-include dnt *.yaml
3
+ recursive-include dnt *.yml
4
+ recursive-include dnt *.names
5
+ recursive-include dnt *.t7
6
+ recursive-exclude __pycache__ *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dnt
3
- Version: 0.2.4
3
+ Version: 0.3.1.3
4
4
  Summary: A Python tool for video-based traffic analytiscs
5
5
  Home-page: https://its.cutr.usf.edu/dnt/
6
6
  Author: Zhenyu Wang
@@ -13,24 +13,42 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Requires-Python: >=3.9
15
15
  License-File: LICENSE
16
- Requires-Dist: numpy
17
- Requires-Dist: pandas
18
- Requires-Dist: matplotlib
19
16
  Requires-Dist: torch
20
17
  Requires-Dist: torchvision
21
18
  Requires-Dist: torchaudio
22
- Requires-Dist: ultralytics
19
+ Requires-Dist: ultralytics>=8.2
20
+ Requires-Dist: cython
21
+ Requires-Dist: cython_bbox
23
22
  Requires-Dist: easydict
23
+ Requires-Dist: faiss-cpu
24
+ Requires-Dist: faiss-gpu
24
25
  Requires-Dist: filterpy
26
+ Requires-Dist: gdown
27
+ Requires-Dist: geopandas
28
+ Requires-Dist: h5py
29
+ Requires-Dist: lap
30
+ Requires-Dist: loguru
25
31
  Requires-Dist: matplotlib
32
+ Requires-Dist: motmetrics
33
+ Requires-Dist: ninja
34
+ Requires-Dist: numpy
26
35
  Requires-Dist: numpy_indexed
27
- Requires-Dist: opencv-python
28
36
  Requires-Dist: opencv-contrib-python
37
+ Requires-Dist: opencv-python
29
38
  Requires-Dist: pandas
30
- Requires-Dist: geopandas
31
- Requires-Dist: shapely
32
- Requires-Dist: scipy
33
- Requires-Dist: scikit-learn
39
+ Requires-Dist: Pillow
40
+ Requires-Dist: prettytable
41
+ Requires-Dist: pycocotools
42
+ Requires-Dist: pyyaml
34
43
  Requires-Dist: scikit-image
44
+ Requires-Dist: scikit-learn
45
+ Requires-Dist: scipy
46
+ Requires-Dist: shapely
47
+ Requires-Dist: sympy
48
+ Requires-Dist: tabulate
49
+ Requires-Dist: tensorboard
50
+ Requires-Dist: termcolor
51
+ Requires-Dist: thop
35
52
  Requires-Dist: tqdm
36
53
  Requires-Dist: vidgear
54
+ Requires-Dist: yacs
@@ -15,8 +15,13 @@ This tool can generate vehicel trajectories using real-time object detection and
15
15
  * Libarary: pytorch (>=1.12 with cuda), pandas, tqdm, numpy, scipy, matplotlib, ultralytics
16
16
 
17
17
  ### Installing
18
-
19
18
  ```
19
+ Setup enviroment:
20
+
21
+ python3.x -m venv dnt (you may replace dnt with you specified name; python version >3.9)
22
+ sudo apt-get install python3.x-dev
23
+ pip install python-dev-tools
24
+
20
25
  pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
21
26
  pip install dnt
22
27
  ```
@@ -0,0 +1,5 @@
1
+ import sys, os
2
+ sys.path.append(os.path.dirname(__file__))
3
+ sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party/fast-reid'))
4
+
5
+ __version__='0.3.1.3'
@@ -0,0 +1,8 @@
1
+ import os
2
+ import sys
3
+
4
+ sys.path.append(os.path.dirname(__file__))
5
+
6
+ from .stop3 import StopAnalyzer
7
+ from .count import Count
8
+ from .interaction import YieldAnalyzer
@@ -0,0 +1,503 @@
1
+ from shapely.geometry import Point, Polygon, LineString, box
2
+ from shapely import intersection, distance, intersects
3
+ from shapelysmooth import taubin_smooth, chaikin_smooth, catmull_rom_smooth
4
+ import geopandas as gpd, pandas as pd
5
+ from tqdm import tqdm
6
+ import numpy as np
7
+ from matplotlib import pyplot as plt
8
+ from dnt.label.labeler2 import Labeler
9
+ import os
10
+ from ..track import Tracker
11
+
12
+ class YieldAnalyzer:
13
+ def __init__(self, waiting_dist_p:int=600, waiting_dist_y:int=300,
14
+ leading_p:bool=False, leading_axis_p:str='y',
15
+ leading_y:bool=True, leading_axis_y:str='x',
16
+ yield_gap:int=10, fps:int=30, ref_point='bc',
17
+ ref_offset:tuple=(0,0), filter_buffer:int=0,
18
+ p_zone:Polygon=None, y_zone:Polygon=None) -> None:
19
+ '''
20
+ Parameters:
21
+ threshold: the hyperparameter to determine if a yield event (frame difference <=yield_gap*fps), default is 3 seconds
22
+ fps: frames per sencond, default is 30
23
+ ref_point: the reference point for lane recognition
24
+ br (buttom-right, default), bl (bottom-left), bc (bottom-center)
25
+ tl (top-left), tr (top-right), tc (top-center)
26
+ cc (center-center), cl (center-left), cr (center-right)
27
+ ref_offset: the offset (x, y) for reference point, default is (0, 0)
28
+ filter_buffer: the buffer between two track frames, default is 0 means tracks will be paired only if two tracks are overlapped in time
29
+ '''
30
+ self.waiting_dist_p = waiting_dist_p
31
+ self.waiting_dist_y = waiting_dist_y
32
+ self.leading_p = leading_p
33
+ self.leading_axis_p = leading_axis_p
34
+ self.leading_y = leading_y
35
+ self.leading_axis_y = leading_axis_y
36
+ self.yield_gap = yield_gap
37
+ self.fps = fps
38
+ self.ref_point = ref_point
39
+ self.ref_offset = ref_offset
40
+ self.filter_buffer = filter_buffer
41
+ self.p_zone = p_zone
42
+ self.y_zone = y_zone
43
+
44
+ def analyze(self, tracks_p:pd.DataFrame, tracks_y:pd.DataFrame, name_p:str='', name_y:str=''):
45
+ '''
46
+ Parameters:
47
+ tracks_p: tracks with priority
48
+ tracks_y: tracks should yield to tracks_p
49
+ '''
50
+ tracks_p = YieldAnalyzer.add_field_names(tracks_p)
51
+ tracks_y = YieldAnalyzer.add_field_names(tracks_y)
52
+
53
+ tracks_p = self.gen_ref(tracks_p, info=name_p)
54
+ tracks_y = self.gen_ref(tracks_y, info=name_y)
55
+
56
+ trajectories_p = self.gen_trajectory(tracks_p, info=name_p)
57
+ trajectories_y = self.gen_trajectory(tracks_y, info=name_y)
58
+
59
+ intersect_pairs = self.scan_intersections(trajectories_p, trajectories_y)
60
+ if (self.p_zone is not None) and (self.y_zone is not None):
61
+ intersect_pairs = self.scan_yield_events_byzone(intersect_pairs, tracks_p, tracks_y)
62
+ else:
63
+ intersect_pairs = self.scan_yield_events(intersect_pairs, tracks_p, tracks_y)
64
+
65
+ return intersect_pairs
66
+
67
+ def gen_ref(self, tracks:pd.DataFrame, info:str='', video_index:int=None, video_tot:int=None)->pd.DataFrame:
68
+ if video_index and video_tot:
69
+ tqdm.pandas(desc='Generating ref {}, {} of {}'.format(info, video_index, video_tot), unit='frames')
70
+ else:
71
+ tqdm.pandas(desc='Generating ref {}'.format(info), unit='frames')
72
+
73
+ if self.ref_point == 'cc':
74
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w']//2 + self.ref_offset[0],
75
+ track['y'] + track['h']//2 + self.ref_offset[1]]), axis=1)
76
+ elif self.ref_point == 'tc':
77
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w']//2 + self.ref_offset[0],
78
+ track['y'] + self.ref_offset[1]]), axis=1)
79
+ elif self.ref_point == 'bc':
80
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w']//2 + self.ref_offset[0],
81
+ track['y'] + track['h'] + self.ref_offset[1]]), axis=1)
82
+ elif self.ref_point == 'cl':
83
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + self.ref_offset[0],
84
+ track['y'] + track['h']//2 + self.ref_offset[1]]), axis=1)
85
+ elif self.ref_point == 'cr':
86
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w'] + self.ref_offset[0],
87
+ track['y'] + track['h']//2 + self.ref_offset[1]]), axis=1)
88
+ elif self.ref_point == 'tl':
89
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + self.ref_offset[0],
90
+ track['y'] + self.ref_offset[1]]), axis=1)
91
+ elif self.ref_point == 'tr':
92
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w'] + self.ref_offset[0],
93
+ track['y'] + self.ref_offset[1]]), axis=1)
94
+ elif self.ref_point == 'bl':
95
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + self.ref_offset[0],
96
+ track['y'] + tracks['h'] + self.ref_offset[1]]), axis=1)
97
+ elif self.ref_point == 'br':
98
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w'] + self.ref_offset[0],
99
+ track['y'] + track['h'] + self.ref_offset[1]]), axis=1)
100
+ else:
101
+ tracks[['ref_x', 'ref_y']] = tracks.progress_apply(lambda track: pd.Series([track['x'] + track['w']//2 + self.ref_offset[0],
102
+ track['y'] + track['h'] + self.ref_offset[1]]), axis=1)
103
+
104
+ return tracks
105
+
106
+ def gen_trajectory(self, tracks:pd.DataFrame, info:str='', video_index:int=None, video_tot:int=None)->gpd.GeoDataFrame:
107
+
108
+ ids = tracks['track'].unique()
109
+ results = []
110
+ lines = []
111
+ pbar = tqdm(total=len(ids), unit='track')
112
+ if video_index and video_tot:
113
+ pbar.desc = 'Generating trajectory {}, {} of {}'.format(info, video_index, video_tot)
114
+ else:
115
+ pbar.desc = 'Generating trajectory {}'.format(info)
116
+
117
+ for id in ids:
118
+ frames = tracks[tracks['track']==id].sort_values(by=['frame'])
119
+ line = LineString(list(zip(frames['ref_x'].values.tolist(), frames['ref_y'].values.tolist())))
120
+ results.append([id, frames['frame'].values, frames['ref_x'].values, frames['ref_y'].values])
121
+ lines.append(line)
122
+ pbar.update()
123
+ pbar.close()
124
+
125
+ df = pd.DataFrame(results, columns=['track', 'frames', 'ref_x', 'ref_y'])
126
+ return gpd.GeoDataFrame(df, geometry=lines)
127
+
128
+ def scan_intersections(self, trajectories_p:gpd.GeoDataFrame, trajectories_y:gpd.GeoDataFrame,
129
+ video_index:int=None, video_tot:int=None):
130
+
131
+ results = []
132
+ points = []
133
+ buffer = self.filter_buffer*self.fps
134
+
135
+ pbar = tqdm(total=len(trajectories_p)*len(trajectories_y), unit=' pair')
136
+ if video_index and video_tot:
137
+ pbar.desc = 'Scan intesections {} of {}'.format(video_index, video_tot)
138
+ else:
139
+ pbar.desc = 'Scan intesections'
140
+ for index1, trj_p in trajectories_p.iterrows():
141
+ for index2, trj_y in trajectories_y.iterrows():
142
+ '''
143
+ if (trj_p['track'] == 511) and (trj_y['track'] == 132590):
144
+ print(trj_p['frames'].min(), trj_p['frames'].max())
145
+ print(trj_y['frames'].min(), trj_y['frames'].max())
146
+ input('...')
147
+ '''
148
+
149
+ if ((trj_p['frames'].min() > (trj_y['frames'].max() + buffer)) or
150
+ (trj_y['frames'].min() > (trj_p['frames'].max() + buffer))):
151
+ pass
152
+ else:
153
+ geo_intersect = intersection(trj_p.geometry, trj_y.geometry)
154
+ if not geo_intersect.is_empty:
155
+ point = self.__recursion(geo_intersect)
156
+ point_xy = np.array([point.x, point.y])
157
+ '''
158
+ if (trj_p['track'] == 2414) & (trj_y['track'] == 386456):
159
+ plt.gca().invert_yaxis()
160
+ plt.plot(*trj_p.geometry.xy, color='red')
161
+ plt.plot(*trj_y.geometry.xy, color='green')
162
+ plt.scatter(*point.xy)
163
+ plt.savefig('/mnt/d/a.jpg')
164
+
165
+ import cv2
166
+ img = cv2.imread('/mnt/d/b.png')
167
+ for x, y in list(zip(trj_p['ref_x'], trj_p['ref_y'])):
168
+ img = cv2.circle(img, (x, y), 1, (0, 0, 255))
169
+ for x, y in list(zip(trj_y['ref_x'], trj_y['ref_y'])):
170
+ img = cv2.circle(img, (x, y), 1, (0, 255, 0))
171
+ img = cv2.circle(img, (int(point.x), int(point.y)), 5, (255, 255, 255), thickness=-1)
172
+ print(int(point.x), int(point.y))
173
+ cv2.imwrite('/mnt/d/c.jpg', img)
174
+ input('...')
175
+ '''
176
+ ref_pxy = np.array(list(zip(trj_p['ref_x'], trj_p['ref_y'])))
177
+ index_p = self.__get_closest_index(ref_pxy, point_xy)
178
+ frame_p = trj_p['frames'][index_p]
179
+
180
+ ref_yxy = np.array(list(zip(trj_y['ref_x'], trj_y['ref_y'])))
181
+ index_y = self.__get_closest_index(ref_yxy, point_xy)
182
+ frame_y = trj_y['frames'][index_y]
183
+
184
+ results.append([trj_p['track'], frame_p, trj_y['track'], frame_y, frame_y-frame_p])
185
+ points.append(point)
186
+ pbar.update()
187
+
188
+ pbar.close()
189
+
190
+ df = pd.DataFrame(results, columns=['track_p', 'frame_p', 'track_y', 'frame_y', 'frame_gap'])
191
+ return gpd.GeoDataFrame(df, geometry=points)
192
+
193
+ def scan_yield_events(self, pairs:gpd.GeoDataFrame, tracks_p:gpd.GeoDataFrame, tracks_y:gpd.GeoDataFrame,
194
+ video_index:int=None, video_tot:int=None)->pd.DataFrame:
195
+
196
+ pbar = tqdm(total=len(pairs), unit=' pair')
197
+ if video_index and video_tot:
198
+ pbar.desc = 'Scan events {} of {}'.format(video_index, video_tot)
199
+ else:
200
+ pbar.desc = 'Scan events'
201
+ for index, pair in pairs.iterrows():
202
+
203
+ if pair['frame_p'] < pair['frame_y']:
204
+
205
+ selected = tracks_y[(tracks_y['track']==pair['track_y']) & (tracks_y['frame']<=pair['frame_y'])].copy() # find the frames for track_y before reaching conflict point
206
+ selected['dif'] = selected['frame'].apply(lambda f: abs(f - pair['frame_p'])) # calculate the frame difference between each before frame and the conflict frame
207
+ selected = selected[selected['dif']<=self.yield_gap] # the frame difference should <= self.yield_gap
208
+ closest = selected[selected['dif']==selected['dif'].min()] # find the closest frame
209
+ if len(closest)>0:
210
+ closest_point = Point(closest['x'].iloc[0]+closest['w'].iloc[0]/2,
211
+ closest['y'].iloc[0]+closest['h'].iloc[0]) # find the cloest point
212
+ dist = distance(closest_point, pair.geometry) # calculate the distance
213
+ pairs.at[index, 'dist_y'] = dist
214
+ inwaiting = 1 if dist<=self.waiting_dist_y else 0
215
+
216
+ if self.leading_y:
217
+ isleading = 1 if self.__is_leading(pair['track_y'], closest['frame'].iloc[0], closest['x'].iloc[0],
218
+ closest['y'].iloc[0], pair.geometry.x, pair.geometry.y, tracks_y, self.leading_axis_y) else 0
219
+ else:
220
+ isleading = 1
221
+
222
+ if (inwaiting == 1) and (isleading == 1):
223
+ pairs.at[index, 'event'] = 'yield'
224
+
225
+ pairs.at[index, 'closest_frame'] = closest['frame'].iloc[0]
226
+
227
+ elif pair['frame_p'] >= pair['frame_y']:
228
+ selected = tracks_p[(tracks_p['track']==pair['track_p']) & (tracks_p['frame']<=pair['frame_p'])].copy()
229
+ selected['dif'] = selected['frame'].apply(lambda f: abs(f - pair['frame_y']))
230
+ selected = selected[selected['dif']<=self.yield_gap]
231
+ closest = selected[selected['dif']==selected['dif'].min()]
232
+ if len(closest)>0:
233
+ closest_point = Point(closest['x'].iloc[0]+closest['w'].iloc[0]/2,
234
+ closest['y'].iloc[0]+closest['h'].iloc[0])
235
+ dist = distance(closest_point, pair.geometry)
236
+ inwaiting = 1 if dist<=self.waiting_dist_p else 0
237
+ pairs.at[index, 'dist_p'] = dist
238
+ if self.leading_p:
239
+ isleading = 1 if self.__is_leading(pair['track_p'], closest['frame'].iloc[0], closest['x'].iloc[0],
240
+ closest['y'].iloc[0], pair.geometry.x, pair.geometry.y, tracks_p, self.leading_axis_p) else 0
241
+ else:
242
+ isleading = 1
243
+
244
+ if (inwaiting == 1) and (isleading == 1):
245
+ pairs.at[index, 'event'] = 'not_yield'
246
+
247
+ pairs.at[index, 'closest_frame'] = closest['frame'].iloc[0]
248
+
249
+ pbar.update()
250
+
251
+ pbar.close()
252
+
253
+ return self.__export(pairs)
254
+
255
+ def scan_yield_events_byzone(self, pairs:gpd.GeoDataFrame, tracks_p:gpd.GeoDataFrame, tracks_y:gpd.GeoDataFrame,
256
+ video_index:int=None, video_tot:int=None)->pd.DataFrame:
257
+
258
+ pbar = tqdm(total=len(pairs), unit=' pair')
259
+ if video_index and video_tot:
260
+ pbar.desc = 'Scan events {} of {}'.format(video_index, video_tot)
261
+ else:
262
+ pbar.desc = 'Scan events'
263
+ for index, pair in pairs.iterrows():
264
+
265
+ if pair['frame_p'] < pair['frame_y']:
266
+
267
+ selected = tracks_y[(tracks_y['track']==pair['track_y']) & (tracks_y['frame']<=pair['frame_y'])].copy() # find the frames for track_y before reaching conflict point
268
+ selected['dif'] = selected['frame'].apply(lambda f: abs(f - pair['frame_p'])) # calculate the frame difference between each before frame and the conflict frame
269
+ selected = selected[selected['dif']<=self.yield_gap] # the frame difference should <= self.yield_gap
270
+ closest = selected[selected['dif']==selected['dif'].min()] # find the closest frame
271
+ if len(closest)>0:
272
+ x, y, w, h = closest['x'].iloc[0], closest['y'].iloc[0], closest['w'].iloc[0], closest['h'].iloc[0]
273
+ closest_bbox = Polygon([(x, y), (x + w, y), (x + w, y + h), (x, y + h)])
274
+
275
+ inwaiting = 1 if intersects(closest_bbox, self.y_zone) else 0
276
+ pairs.at[index, 'dist_y'] = -1
277
+ if self.leading_y:
278
+ isleading = 1 if self.__is_leading(pair['track_y'], closest['frame'].iloc[0], closest['x'].iloc[0],
279
+ closest['y'].iloc[0], pair.geometry.x, pair.geometry.y, tracks_y, self.leading_axis_y) else 0
280
+ else:
281
+ isleading = 1
282
+
283
+ if (inwaiting == 1) and (isleading == 1):
284
+ pairs.at[index, 'event'] = 'yield'
285
+
286
+ pairs.at[index, 'closest_frame'] = closest['frame'].iloc[0]
287
+
288
+ elif pair['frame_p'] >= pair['frame_y']:
289
+ selected = tracks_p[(tracks_p['track']==pair['track_p']) & (tracks_p['frame']<=pair['frame_p'])].copy()
290
+ selected['dif'] = selected['frame'].apply(lambda f: abs(f - pair['frame_y']))
291
+ selected = selected[selected['dif']<=self.yield_gap]
292
+ closest = selected[selected['dif']==selected['dif'].min()]
293
+ if len(closest)>0:
294
+ x, y, w, h = closest['x'].iloc[0], closest['y'].iloc[0], closest['w'].iloc[0], closest['h'].iloc[0]
295
+ closest_bbox = Polygon([(x, y), (x + w, y), (x + w, y + h), (x, y + h)])
296
+
297
+ inwaiting = 1 if intersects(closest_bbox, self.p_zone) else 0
298
+ pairs.at[index, 'dist_p'] = -1
299
+ if self.leading_p:
300
+ isleading = 1 if self.__is_leading(pair['track_p'], closest['frame'].iloc[0], closest['x'].iloc[0],
301
+ closest['y'].iloc[0], pair.geometry.x, pair.geometry.y, tracks_p, self.leading_axis_p) else 0
302
+ else:
303
+ isleading = 1
304
+
305
+ if (inwaiting == 1) and (isleading == 1):
306
+ pairs.at[index, 'event'] = 'not_yield'
307
+
308
+ pairs.at[index, 'closest_frame'] = closest['frame'].iloc[0]
309
+
310
+ pbar.update()
311
+
312
+ pbar.close()
313
+
314
+ return self.__export(pairs)
315
+
316
+
317
+ def __export(self, pairs:gpd.GeoDataFrame):
318
+ pairs['int_x'] = pairs.geometry.x
319
+ pairs['int_y'] = pairs.geometry.y
320
+ return pd.DataFrame(pairs.drop(columns=['geometry']))
321
+
322
+ def __recursion(self, intersect):
323
+ if intersect.geom_type == 'Point':
324
+ return Point(intersect.coords[0])
325
+
326
+ elif intersect.geom_type == 'MultiPoint':
327
+ return Point(intersect.geoms[0].x, intersect.geoms[0].y)
328
+
329
+ elif intersect.geom_type == 'LineString':
330
+ return Point(intersect.coords[0])
331
+
332
+ elif intersect.geom_type == 'MultiLineString':
333
+ return Point(intersect.geoms[0].coords[0])
334
+
335
+ else:
336
+ for geom in intersect.geoms:
337
+ return self.__recursion(geom)
338
+
339
+ def __get_closest_index(self, ref:np.array, point:np.array) -> int:
340
+ return np.argmin(np.sqrt(np.sum(np.square(ref - point), axis=1)))
341
+
342
+ def __is_leading(self, track_id:int, frame_close:int, close_x:int, close_y:int, int_x:int, int_y:int,
343
+ tracks:gpd.GeoDataFrame, leading_axis:str):
344
+
345
+ min_x = min(close_x, int_x)
346
+ max_x = max(close_x, int_x)
347
+ min_y = min(close_y, int_y)
348
+ max_y = max(close_y, int_y)
349
+ if leading_axis == 'x':
350
+ leadings = tracks[(tracks['track']!=track_id) & (tracks['frame']==frame_close) &
351
+ (tracks['ref_x']>=min_x) & (tracks['ref_x']<=max_x)]
352
+ elif leading_axis == 'y':
353
+ leadings = tracks[(tracks['track']!=track_id) & (tracks['frame']==frame_close) &
354
+ (tracks['ref_y']>=min_y) & (tracks['ref_y']<=max_y)]
355
+ elif leading_axis == 'xy':
356
+ leadings = tracks[(tracks['track']!=track_id) & (tracks['frame']==frame_close) &
357
+ (tracks['ref_x']>=min_x) & (tracks['ref_x']<=max_x) &
358
+ (tracks['ref_y']>=min_y) & (tracks['ref_y']<=max_y)]
359
+
360
+ if len(leadings) > 0:
361
+ return False
362
+ else:
363
+ return True
364
+
365
+ def __get_waiting_trj_y(self, track_id:int, frame_id_p:int, frame_id_y:int, intersect_point:Point, trajectories:gpd.GeoDataFrame) -> any:
366
+
367
+ result = -1
368
+ if frame_id_p < frame_id_y:
369
+ selected = trajectories[trajectories['track']==track_id]
370
+ df = pd.DataFrame(np.vstack((selected['frames'].tolist(), selected['ref_x'].tolist(), selected['ref_y'].tolist())).T,
371
+ columns=['frame', 'x', 'y'])
372
+ df = df.loc[df['frame']<=frame_id_y]
373
+ df['dif'] = df['frame'].apply(lambda f: abs((f - frame_id_p)))
374
+ closest = df[df['dif']==df['dif'].min()]
375
+ closest_point = Point(closest['x'].ioc[0], closest['y'].ioc[0])
376
+ dist = distance(closest, intersect_point)
377
+
378
+ return result
379
+
380
+ @staticmethod
381
+ def add_field_names(tracks: pd.DataFrame)->pd.DataFrame:
382
+ if len(tracks.columns)==10:
383
+ tracks.columns = ['frame', 'track', 'x', 'y', 'w', 'h', 'score', 'cls', 'r3','r4']
384
+ tracks['ref_x'] = -1
385
+ tracks['ref_y'] = -1
386
+ elif len(tracks.columns) == 12:
387
+ tracks.columns = ['frame', 'track', 'x', 'y', 'w', 'h', 'score', 'cls', 'r3','r4',
388
+ 'ref_x', 'ref_y']
389
+ else:
390
+ raise Exception('The number of fields is invalid.')
391
+ return tracks
392
+
393
+ @staticmethod
394
+ def draw_event_clips(yields:pd.DataFrame, tracks_p:pd.DataFrame, tracks_y:pd.DataFrame, input_video:str, out_path:str,
395
+ method:str='all', random_number:int=10, event_list:list=None, size:int=1, thick:int=2, padding:int=0,
396
+ show_track:bool=False, show_desc:bool=False, verbose:bool=True,
397
+ video_index:int=None, video_tot:int=None):
398
+ '''
399
+ Parameters:
400
+ - yields: the dataframe of stop events
401
+ - tracks_p: the dataframe of tracks with priority
402
+ - tracks_y: the dataframe of tracks should yield
403
+ - input_video: the raw video file, if None, generate the label files only
404
+ - out_path: the folder for outputing track clips
405
+ - method: 'all' (default) - all tracks, 'specify' - specify events,
406
+ 'yield' - yield events, 'not_yield' - non-yield events, 'none' - non interaction events
407
+ - random_number: the number of track ids if method == 'random'
408
+ - event_list: the list of events [(track_p_id, track_y_id)] if method == 'specify'
409
+ - size: font size, default is 1
410
+ - thick: line thinckness, defualt is 2
411
+ - padding: add addtional frames at beggining and ending, default is 0
412
+ - show_track: show track id, default is False
413
+ - show_desc: show event desc, default is Falase
414
+ - verbose: if show progressing bar, default is True
415
+ - video_idex: the index of the video in processing
416
+ - video_tot: the total number of videos
417
+
418
+ Return:
419
+ - A list of dataframes for labels, ['frame','type','coords','color','size','thick','desc']
420
+ '''
421
+
422
+ tracks_p = YieldAnalyzer.add_field_names(tracks_p)
423
+ tracks_y = YieldAnalyzer.add_field_names(tracks_y)
424
+
425
+ tracks_p_grouped = tracks_p.groupby('track')
426
+ tracks_y_grouped = tracks_y.groupby('track')
427
+
428
+
429
+ if method == 'all':
430
+ events = yields
431
+ elif method == 'specify':
432
+ events = []
433
+ for p, y in event_list:
434
+ events.append(yields[(yields['track_p']==p) & (yields['track_y']==y)])
435
+ events = pd.concat(events)
436
+ elif method == 'yield':
437
+ events = yields[yields['event']=='yield'].copy()
438
+ elif method == 'not_yield':
439
+ events = yields[yields['event']=='not_yield'].copy()
440
+ elif method == 'event':
441
+ events = yields[yields['event'].isin(['yield', 'not_yield'])].copy()
442
+ elif method == 'none':
443
+ events = yields[~yields['event'].isin(['yield', 'not_yield'])].copy()
444
+
445
+ pbar = tqdm(total= len(events) , unit='event')
446
+ if video_index and video_tot:
447
+ pbar.set_description_str("Generating labeles for yielding events {} of {}".format(video_index, video_tot))
448
+ else:
449
+ pbar.set_description_str("Generating labels for yielding events")
450
+
451
+ labeler = Labeler()
452
+ for index, event in events.iterrows():
453
+ result = []
454
+ track_p_id = event['track_p']
455
+ track_y_id = event['track_y']
456
+ int_x = int(event['int_x'])
457
+ int_y = int(event['int_y'])
458
+
459
+ if event['event'] == 'yield':
460
+ desc = 'yield'
461
+ color = (0, 255, 0)
462
+ elif event['event'] == 'not_yield':
463
+ desc = 'not yield'
464
+ color = (0, 0, 255)
465
+ else:
466
+ desc = 'no interaction'
467
+ color = (255, 0, 0)
468
+
469
+ frames_p = tracks_p_grouped.get_group(track_p_id)
470
+ frames_y = tracks_y_grouped.get_group(track_y_id)
471
+ frames = pd.concat([frames_p, frames_y])
472
+ for index2, frame in frames.iterrows():
473
+ label_text = ''
474
+ if show_track:
475
+ label_text+='| T:'+str(int(frame['track']))
476
+
477
+ if show_desc:
478
+ label_text+= ' | '+desc
479
+
480
+ result.append([frame['frame'], 'bbox', [(frame['x'], frame['y']), (frame['x']+frame['w'], frame['y']+frame['h'])],
481
+ color, size, thick, label_text])
482
+ result.append([frame['frame'], 'box', [(int_x - 5, int_y - 5), (int_x + 5, int_y + 5)],
483
+ (255, 255, 0), size, thick, ''])
484
+
485
+ df = pd.DataFrame(result, columns=['frame','type','coords','color','size','thick','desc'])
486
+
487
+ if out_path:
488
+ file_name = os.path.join(out_path, str(track_p_id)+'-'+str(track_y_id)+'_label.csv')
489
+ df.to_csv(file_name, index=False)
490
+
491
+ if input_video:
492
+ file_name = os.path.join(out_path, str(track_p_id)+'-'+str(track_y_id)+'_label.mp4')
493
+ min_frame = df['frame'].min() - padding
494
+ max_frame = df['frame'].max() + padding
495
+ labeler.draw(input_video=input_video, output_video=file_name, draws=df,
496
+ start_frame=min_frame, end_frame=max_frame, verbose=False)
497
+
498
+ if verbose:
499
+ pbar.update()
500
+
501
+ pbar.close()
502
+
503
+
File without changes