dnt 0.2.4__py3-none-any.whl → 0.3.1.8__py3-none-any.whl

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.
Files changed (312) hide show
  1. dnt/__init__.py +3 -2
  2. dnt/analysis/__init__.py +3 -2
  3. dnt/analysis/count.py +54 -37
  4. dnt/analysis/interaction2.py +518 -0
  5. dnt/analysis/stop.py +22 -17
  6. dnt/analysis/stop2.py +289 -0
  7. dnt/analysis/stop3.py +758 -0
  8. dnt/detect/signal/detector.py +326 -0
  9. dnt/detect/timestamp.py +105 -0
  10. dnt/detect/yolov8/detector.py +179 -36
  11. dnt/detect/yolov8/segmentor.py +60 -2
  12. dnt/engine/__init__.py +8 -0
  13. dnt/engine/bbox_interp.py +83 -0
  14. dnt/engine/bbox_iou.py +20 -0
  15. dnt/engine/cluster.py +31 -0
  16. dnt/engine/iob.py +66 -0
  17. dnt/filter/filter.py +333 -2
  18. dnt/label/labeler.py +4 -4
  19. dnt/label/labeler2.py +631 -0
  20. dnt/shared/__init__.py +2 -1
  21. dnt/shared/data/coco.names +0 -0
  22. dnt/shared/data/openimages.names +0 -0
  23. dnt/shared/data/voc.names +0 -0
  24. dnt/shared/download.py +12 -0
  25. dnt/shared/synhcro.py +150 -0
  26. dnt/shared/util.py +17 -4
  27. dnt/third_party/fast-reid/__init__.py +1 -0
  28. dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
  29. dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
  30. dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
  31. dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
  32. dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
  33. dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
  34. dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
  35. dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
  36. dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
  37. dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
  38. dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
  39. dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
  40. dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
  41. dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
  42. dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
  43. dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
  44. dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
  45. dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
  46. dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
  47. dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
  48. dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
  49. dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
  50. dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
  51. dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
  52. dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
  53. dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
  54. dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
  55. dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
  56. dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
  57. dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
  58. dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
  59. dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
  60. dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
  61. dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
  62. dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
  63. dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
  64. dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
  65. dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
  66. dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
  67. dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
  68. dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
  69. dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
  70. dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
  71. dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
  72. dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
  73. dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
  74. dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
  75. dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
  76. dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
  77. dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
  78. dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
  79. dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
  80. dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
  81. dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
  82. dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
  83. dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
  84. dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
  85. dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
  86. dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
  87. dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
  88. dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
  89. dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
  90. dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
  91. dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
  92. dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
  93. dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
  94. dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
  95. dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
  96. dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
  97. dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
  98. dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
  99. dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
  100. dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
  101. dnt/third_party/fast-reid/configs/__init__.py +0 -0
  102. dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
  103. dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
  104. dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
  105. dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
  106. dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
  107. dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
  108. dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
  109. dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
  110. dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
  111. dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
  112. dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
  113. dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
  114. dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
  115. dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
  116. dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
  117. dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
  118. dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
  119. dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
  120. dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
  121. dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
  122. dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
  123. dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
  124. dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
  125. dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
  126. dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
  127. dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
  128. dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
  129. dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
  130. dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
  131. dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
  132. dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
  133. dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
  134. dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
  135. dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
  136. dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
  137. dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
  138. dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
  139. dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
  140. dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
  141. dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
  142. dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
  143. dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
  144. dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
  145. dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
  146. dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
  147. dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
  148. dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
  149. dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
  150. dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
  151. dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
  152. dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
  153. dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
  154. dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
  155. dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
  156. dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
  157. dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
  158. dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
  159. dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
  160. dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
  161. dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
  162. dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
  163. dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
  164. dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
  165. dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
  166. dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
  167. dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
  168. dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
  169. dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
  170. dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
  171. dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
  172. dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
  173. dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
  174. dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
  175. dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
  176. dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
  177. dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
  178. dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
  179. dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
  180. dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
  181. dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
  182. dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
  183. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
  184. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
  185. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
  186. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
  187. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
  188. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
  189. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
  190. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
  191. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
  192. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
  193. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
  194. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
  195. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
  196. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
  197. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
  198. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
  199. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
  200. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
  201. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
  202. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
  203. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
  204. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
  205. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
  206. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
  207. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
  208. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
  209. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
  210. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
  211. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
  212. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
  213. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
  214. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
  215. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
  216. dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
  217. dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
  218. dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
  219. dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
  220. dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
  221. dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
  222. dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
  223. dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
  224. dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
  225. dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
  226. dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
  227. dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
  228. dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
  229. dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
  230. dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
  231. dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
  232. dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
  233. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
  234. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
  235. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
  236. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
  237. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
  238. dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
  239. dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
  240. dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
  241. dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
  242. dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
  243. dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
  244. dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
  245. dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
  246. dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
  247. dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
  248. dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
  249. dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
  250. dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
  251. dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
  252. dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
  253. dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
  254. dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
  255. dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
  256. dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
  257. dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
  258. dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
  259. dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
  260. dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
  261. dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
  262. dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
  263. dnt/track/__init__.py +2 -0
  264. dnt/track/botsort/__init__.py +4 -0
  265. dnt/track/botsort/bot_tracker/__init__.py +3 -0
  266. dnt/track/botsort/bot_tracker/basetrack.py +60 -0
  267. dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
  268. dnt/track/botsort/bot_tracker/gmc.py +316 -0
  269. dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
  270. dnt/track/botsort/bot_tracker/matching.py +194 -0
  271. dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
  272. dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
  273. dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/io.py +19 -36
  274. dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
  275. dnt/track/botsort/inference.py +96 -0
  276. dnt/track/config.py +120 -0
  277. dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
  278. dnt/track/dsort/configs/deep_sort.yaml +0 -0
  279. dnt/track/dsort/configs/fastreid.yaml +1 -1
  280. dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
  281. dnt/track/dsort/deep_sort/deep/feature_extractor.py +87 -8
  282. dnt/track/dsort/deep_sort/deep_sort.py +31 -20
  283. dnt/track/dsort/deep_sort/sort/detection.py +2 -1
  284. dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
  285. dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
  286. dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
  287. dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
  288. dnt/track/dsort/deep_sort/sort/track.py +2 -1
  289. dnt/track/dsort/deep_sort/sort/tracker.py +1 -1
  290. dnt/track/dsort/dsort.py +43 -33
  291. dnt/track/re_class.py +117 -0
  292. dnt/track/sort/sort.py +9 -6
  293. dnt/track/tracker.py +213 -32
  294. dnt-0.3.1.8.dist-info/METADATA +117 -0
  295. dnt-0.3.1.8.dist-info/RECORD +315 -0
  296. {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info}/WHEEL +1 -1
  297. dnt/analysis/yield.py +0 -9
  298. dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
  299. dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
  300. dnt/track/dsort/deep_sort/deep/test.py +0 -77
  301. dnt/track/dsort/deep_sort/deep/train.py +0 -189
  302. dnt/track/dsort/utils/asserts.py +0 -13
  303. dnt/track/dsort/utils/draw.py +0 -36
  304. dnt/track/dsort/utils/json_logger.py +0 -383
  305. dnt/track/dsort/utils/log.py +0 -17
  306. dnt/track/dsort/utils/parser.py +0 -35
  307. dnt/track/dsort/utils/tools.py +0 -39
  308. dnt-0.2.4.dist-info/METADATA +0 -35
  309. dnt-0.2.4.dist-info/RECORD +0 -64
  310. /dnt/{track/dsort/utils → third_party/fast-reid/checkpoint}/__init__.py +0 -0
  311. {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info/licenses}/LICENSE +0 -0
  312. {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,202 @@
1
+ # encoding: utf-8
2
+ """
3
+ @author: liaoxingyu
4
+ @contact: sherlockliao01@gmail.com
5
+ """
6
+ import torch
7
+ import numpy as np
8
+ from PIL import Image, ImageOps
9
+ import threading
10
+
11
+ import queue
12
+ from torch.utils.data import DataLoader
13
+
14
+ from fastreid.utils.file_io import PathManager
15
+
16
+
17
+ def read_image(file_name, format=None):
18
+ """
19
+ Read an image into the given format.
20
+ Will apply rotation and flipping if the image has such exif information.
21
+
22
+ Args:
23
+ file_name (str): image file path
24
+ format (str): one of the supported image modes in PIL, or "BGR"
25
+ Returns:
26
+ image (np.ndarray): an HWC image
27
+ """
28
+ with PathManager.open(file_name, "rb") as f:
29
+ image = Image.open(f)
30
+
31
+ # work around this bug: https://github.com/python-pillow/Pillow/issues/3973
32
+ try:
33
+ image = ImageOps.exif_transpose(image)
34
+ except Exception:
35
+ pass
36
+
37
+ if format is not None:
38
+ # PIL only supports RGB, so convert to RGB and flip channels over below
39
+ conversion_format = format
40
+ if format == "BGR":
41
+ conversion_format = "RGB"
42
+ image = image.convert(conversion_format)
43
+ image = np.asarray(image)
44
+
45
+ # PIL squeezes out the channel dimension for "L", so make it HWC
46
+ if format == "L":
47
+ image = np.expand_dims(image, -1)
48
+
49
+ # handle formats not supported by PIL
50
+ elif format == "BGR":
51
+ # flip channels if needed
52
+ image = image[:, :, ::-1]
53
+
54
+ # handle grayscale mixed in RGB images
55
+ elif len(image.shape) == 2:
56
+ image = np.repeat(image[..., np.newaxis], 3, axis=-1)
57
+
58
+ image = Image.fromarray(image)
59
+
60
+ return image
61
+
62
+
63
+ """
64
+ #based on http://stackoverflow.com/questions/7323664/python-generator-pre-fetch
65
+ This is a single-function package that transforms arbitrary generator into a background-thead generator that
66
+ prefetches several batches of data in a parallel background thead.
67
+
68
+ This is useful if you have a computationally heavy process (CPU or GPU) that
69
+ iteratively processes minibatches from the generator while the generator
70
+ consumes some other resource (disk IO / loading from database / more CPU if you have unused cores).
71
+
72
+ By default these two processes will constantly wait for one another to finish. If you make generator work in
73
+ prefetch mode (see examples below), they will work in parallel, potentially saving you your GPU time.
74
+ We personally use the prefetch generator when iterating minibatches of data for deep learning with PyTorch etc.
75
+
76
+ Quick usage example (ipython notebook) - https://github.com/justheuristic/prefetch_generator/blob/master/example.ipynb
77
+ This package contains this object
78
+ - BackgroundGenerator(any_other_generator[,max_prefetch = something])
79
+ """
80
+
81
+
82
+ class BackgroundGenerator(threading.Thread):
83
+ """
84
+ the usage is below
85
+ >> for batch in BackgroundGenerator(my_minibatch_iterator):
86
+ >> doit()
87
+ More details are written in the BackgroundGenerator doc
88
+ >> help(BackgroundGenerator)
89
+ """
90
+
91
+ def __init__(self, generator, local_rank, max_prefetch=10):
92
+ """
93
+ This function transforms generator into a background-thead generator.
94
+ :param generator: generator or genexp or any
95
+ It can be used with any minibatch generator.
96
+
97
+ It is quite lightweight, but not entirely weightless.
98
+ Using global variables inside generator is not recommended (may raise GIL and zero-out the
99
+ benefit of having a background thread.)
100
+ The ideal use case is when everything it requires is store inside it and everything it
101
+ outputs is passed through queue.
102
+
103
+ There's no restriction on doing weird stuff, reading/writing files, retrieving
104
+ URLs [or whatever] wlilst iterating.
105
+
106
+ :param max_prefetch: defines, how many iterations (at most) can background generator keep
107
+ stored at any moment of time.
108
+ Whenever there's already max_prefetch batches stored in queue, the background process will halt until
109
+ one of these batches is dequeued.
110
+
111
+ !Default max_prefetch=1 is okay unless you deal with some weird file IO in your generator!
112
+
113
+ Setting max_prefetch to -1 lets it store as many batches as it can, which will work
114
+ slightly (if any) faster, but will require storing
115
+ all batches in memory. If you use infinite generator with max_prefetch=-1, it will exceed the RAM size
116
+ unless dequeued quickly enough.
117
+ """
118
+ super().__init__()
119
+ self.queue = queue.Queue(max_prefetch)
120
+ self.generator = generator
121
+ self.local_rank = local_rank
122
+ self.daemon = True
123
+ self.exit_event = threading.Event()
124
+ self.start()
125
+
126
+ def run(self):
127
+ torch.cuda.set_device(self.local_rank)
128
+ for item in self.generator:
129
+ if self.exit_event.is_set():
130
+ break
131
+ self.queue.put(item)
132
+ self.queue.put(None)
133
+
134
+ def next(self):
135
+ next_item = self.queue.get()
136
+ if next_item is None:
137
+ raise StopIteration
138
+ return next_item
139
+
140
+ # Python 3 compatibility
141
+ def __next__(self):
142
+ return self.next()
143
+
144
+ def __iter__(self):
145
+ return self
146
+
147
+
148
+ class DataLoaderX(DataLoader):
149
+ def __init__(self, local_rank, **kwargs):
150
+ super().__init__(**kwargs)
151
+ self.stream = torch.cuda.Stream(
152
+ local_rank
153
+ ) # create a new cuda stream in each process
154
+ self.local_rank = local_rank
155
+
156
+ def __iter__(self):
157
+ self.iter = super().__iter__()
158
+ self.iter = BackgroundGenerator(self.iter, self.local_rank)
159
+ self.preload()
160
+ return self
161
+
162
+ def _shutdown_background_thread(self):
163
+ if not self.iter.is_alive():
164
+ # avoid re-entrance or ill-conditioned thread state
165
+ return
166
+
167
+ # Set exit event to True for background threading stopping
168
+ self.iter.exit_event.set()
169
+
170
+ # Exhaust all remaining elements, so that the queue becomes empty,
171
+ # and the thread should quit
172
+ for _ in self.iter:
173
+ pass
174
+
175
+ # Waiting for background thread to quit
176
+ self.iter.join()
177
+
178
+ def preload(self):
179
+ self.batch = next(self.iter, None)
180
+ if self.batch is None:
181
+ return None
182
+ with torch.cuda.stream(self.stream):
183
+ for k in self.batch:
184
+ if isinstance(self.batch[k], torch.Tensor):
185
+ self.batch[k] = self.batch[k].to(
186
+ device=self.local_rank, non_blocking=True
187
+ )
188
+
189
+ def __next__(self):
190
+ torch.cuda.current_stream().wait_stream(
191
+ self.stream
192
+ ) # wait tensor to put on GPU
193
+ batch = self.batch
194
+ if batch is None:
195
+ raise StopIteration
196
+ self.preload()
197
+ return batch
198
+
199
+ # Signal for shutting down background thread
200
+ def shutdown(self):
201
+ # If the dataloader is to be freed, shutdown its BackgroundGenerator
202
+ self._shutdown_background_thread()
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ """
3
+ @author: xingyu liao
4
+ @contact: sherlockliao01@gmail.com
5
+ """
6
+
7
+ import os
8
+
9
+ from fastreid.data.datasets import DATASET_REGISTRY
10
+ from fastreid.data.datasets.bases import ImageDataset
11
+
12
+ __all__ = ['AirportALERT', ]
13
+
14
+
15
+ @DATASET_REGISTRY.register()
16
+ class AirportALERT(ImageDataset):
17
+ """Airport
18
+
19
+ """
20
+ dataset_dir = "AirportALERT"
21
+ dataset_name = "airport"
22
+
23
+ def __init__(self, root='datasets', **kwargs):
24
+ self.root = root
25
+ self.train_path = os.path.join(self.root, self.dataset_dir)
26
+ self.train_file = os.path.join(self.root, self.dataset_dir, 'filepath.txt')
27
+
28
+ required_files = [self.train_file, self.train_path]
29
+ self.check_before_run(required_files)
30
+
31
+ train = self.process_train(self.train_path, self.train_file)
32
+
33
+ super().__init__(train, [], [], **kwargs)
34
+
35
+ def process_train(self, dir_path, train_file):
36
+ data = []
37
+ with open(train_file, "r") as f:
38
+ img_paths = [line.strip('\n') for line in f.readlines()]
39
+
40
+ for path in img_paths:
41
+ split_path = path.split('\\')
42
+ img_path = '/'.join(split_path)
43
+ camid = self.dataset_name + "_" + split_path[0]
44
+ pid = self.dataset_name + "_" + split_path[1]
45
+ img_path = os.path.join(dir_path, img_path)
46
+ # if 11001 <= int(split_path[1]) <= 401999:
47
+ if 11001 <= int(split_path[1]):
48
+ data.append([img_path, pid, camid])
49
+
50
+ return data
@@ -0,0 +1,43 @@
1
+ # encoding: utf-8
2
+ """
3
+ @author: liaoxingyu
4
+ @contact: sherlockliao01@gmail.com
5
+ """
6
+
7
+ from ...utils.registry import Registry
8
+
9
+ DATASET_REGISTRY = Registry("DATASET")
10
+ DATASET_REGISTRY.__doc__ = """
11
+ Registry for datasets
12
+ It must returns an instance of :class:`Backbone`.
13
+ """
14
+
15
+ # Person re-id datasets
16
+ from .cuhk03 import CUHK03
17
+ from .dukemtmcreid import DukeMTMC
18
+ from .market1501 import Market1501
19
+ from .msmt17 import MSMT17
20
+ from .AirportALERT import AirportALERT
21
+ from .iLIDS import iLIDS
22
+ from .pku import PKU
23
+ from .prai import PRAI
24
+ from .prid import PRID
25
+ from .grid import GRID
26
+ from .saivt import SAIVT
27
+ from .sensereid import SenseReID
28
+ from .sysu_mm import SYSU_mm
29
+ from .thermalworld import Thermalworld
30
+ from .pes3d import PeS3D
31
+ from .caviara import CAVIARa
32
+ from .viper import VIPeR
33
+ from .lpw import LPW
34
+ from .shinpuhkan import Shinpuhkan
35
+ from .wildtracker import WildTrackCrop
36
+ from .cuhk_sysu import cuhkSYSU
37
+
38
+ # Vehicle re-id datasets
39
+ from .veri import VeRi
40
+ from .vehicleid import VehicleID, SmallVehicleID, MediumVehicleID, LargeVehicleID
41
+ from .veriwild import VeRiWild, SmallVeRiWild, MediumVeRiWild, LargeVeRiWild
42
+
43
+ __all__ = [k for k in globals().keys() if "builtin" not in k and not k.startswith("_")]
@@ -0,0 +1,183 @@
1
+ # encoding: utf-8
2
+ """
3
+ @author: sherlock
4
+ @contact: sherlockliao01@gmail.com
5
+ """
6
+
7
+ import copy
8
+ import logging
9
+ import os
10
+
11
+ from tabulate import tabulate
12
+ from termcolor import colored
13
+
14
+ logger = logging.getLogger(__name__)
15
+
16
+
17
+ class Dataset(object):
18
+ """An abstract class representing a Dataset.
19
+ This is the base class for ``ImageDataset`` and ``VideoDataset``.
20
+
21
+ Args:
22
+ train (list or Callable): contains tuples of (img_path(s), pid, camid).
23
+ query (list or Callable): contains tuples of (img_path(s), pid, camid).
24
+ gallery (list or Callable): contains tuples of (img_path(s), pid, camid).
25
+ transform: transform function.
26
+ mode (str): 'train', 'query' or 'gallery'.
27
+ combineall (bool): combines train, query and gallery in a
28
+ dataset for training.
29
+ verbose (bool): show information.
30
+ """
31
+ _junk_pids = [] # contains useless person IDs, e.g. background, false detections
32
+
33
+ def __init__(self, train, query, gallery, transform=None, mode='train',
34
+ combineall=False, verbose=True, **kwargs):
35
+ self._train = train
36
+ self._query = query
37
+ self._gallery = gallery
38
+ self.transform = transform
39
+ self.mode = mode
40
+ self.combineall = combineall
41
+ self.verbose = verbose
42
+
43
+ if self.combineall:
44
+ self.combine_all()
45
+
46
+ if self.mode == 'train':
47
+ self.data = self.train
48
+ elif self.mode == 'query':
49
+ self.data = self.query
50
+ elif self.mode == 'gallery':
51
+ self.data = self.gallery
52
+ else:
53
+ raise ValueError('Invalid mode. Got {}, but expected to be '
54
+ 'one of [train | query | gallery]'.format(self.mode))
55
+
56
+ @property
57
+ def train(self):
58
+ if callable(self._train):
59
+ self._train = self._train()
60
+ return self._train
61
+
62
+ @property
63
+ def query(self):
64
+ if callable(self._query):
65
+ self._query = self._query()
66
+ return self._query
67
+
68
+ @property
69
+ def gallery(self):
70
+ if callable(self._gallery):
71
+ self._gallery = self._gallery()
72
+ return self._gallery
73
+
74
+ def __getitem__(self, index):
75
+ raise NotImplementedError
76
+
77
+ def __len__(self):
78
+ return len(self.data)
79
+
80
+ def __radd__(self, other):
81
+ """Supports sum([dataset1, dataset2, dataset3])."""
82
+ if other == 0:
83
+ return self
84
+ else:
85
+ return self.__add__(other)
86
+
87
+ def parse_data(self, data):
88
+ """Parses data list and returns the number of person IDs
89
+ and the number of camera views.
90
+ Args:
91
+ data (list): contains tuples of (img_path(s), pid, camid)
92
+ """
93
+ pids = set()
94
+ cams = set()
95
+ for info in data:
96
+ pids.add(info[1])
97
+ cams.add(info[2])
98
+ return len(pids), len(cams)
99
+
100
+ def get_num_pids(self, data):
101
+ """Returns the number of training person identities."""
102
+ return self.parse_data(data)[0]
103
+
104
+ def get_num_cams(self, data):
105
+ """Returns the number of training cameras."""
106
+ return self.parse_data(data)[1]
107
+
108
+ def show_summary(self):
109
+ """Shows dataset statistics."""
110
+ pass
111
+
112
+ def combine_all(self):
113
+ """Combines train, query and gallery in a dataset for training."""
114
+ combined = copy.deepcopy(self.train)
115
+
116
+ def _combine_data(data):
117
+ for img_path, pid, camid in data:
118
+ if pid in self._junk_pids:
119
+ continue
120
+ pid = getattr(self, "dataset_name", "Unknown") + "_test_" + str(pid)
121
+ camid = getattr(self, "dataset_name", "Unknown") + "_test_" + str(camid)
122
+ combined.append((img_path, pid, camid))
123
+
124
+ _combine_data(self.query)
125
+ _combine_data(self.gallery)
126
+
127
+ self._train = combined
128
+
129
+ def check_before_run(self, required_files):
130
+ """Checks if required files exist before going deeper.
131
+ Args:
132
+ required_files (str or list): string file name(s).
133
+ """
134
+ if isinstance(required_files, str):
135
+ required_files = [required_files]
136
+
137
+ for fpath in required_files:
138
+ if not os.path.exists(fpath):
139
+ raise RuntimeError('"{}" is not found'.format(fpath))
140
+
141
+
142
+ class ImageDataset(Dataset):
143
+ """A base class representing ImageDataset.
144
+ All other image datasets should subclass it.
145
+ ``__getitem__`` returns an image given index.
146
+ It will return ``img``, ``pid``, ``camid`` and ``img_path``
147
+ where ``img`` has shape (channel, height, width). As a result,
148
+ data in each batch has shape (batch_size, channel, height, width).
149
+ """
150
+
151
+ def show_train(self):
152
+ num_train_pids, num_train_cams = self.parse_data(self.train)
153
+
154
+ headers = ['subset', '# ids', '# images', '# cameras']
155
+ csv_results = [['train', num_train_pids, len(self.train), num_train_cams]]
156
+
157
+ # tabulate it
158
+ table = tabulate(
159
+ csv_results,
160
+ tablefmt="pipe",
161
+ headers=headers,
162
+ numalign="left",
163
+ )
164
+ logger.info(f"=> Loaded {self.__class__.__name__} in csv format: \n" + colored(table, "cyan"))
165
+
166
+ def show_test(self):
167
+ num_query_pids, num_query_cams = self.parse_data(self.query)
168
+ num_gallery_pids, num_gallery_cams = self.parse_data(self.gallery)
169
+
170
+ headers = ['subset', '# ids', '# images', '# cameras']
171
+ csv_results = [
172
+ ['query', num_query_pids, len(self.query), num_query_cams],
173
+ ['gallery', num_gallery_pids, len(self.gallery), num_gallery_cams],
174
+ ]
175
+
176
+ # tabulate it
177
+ table = tabulate(
178
+ csv_results,
179
+ tablefmt="pipe",
180
+ headers=headers,
181
+ numalign="left",
182
+ )
183
+ logger.info(f"=> Loaded {self.__class__.__name__} in csv format: \n" + colored(table, "cyan"))
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+ """
3
+ @author: xingyu liao
4
+ @contact: sherlockliao01@gmail.com
5
+ """
6
+
7
+ import os
8
+ from glob import glob
9
+
10
+ from fastreid.data.datasets import DATASET_REGISTRY
11
+ from fastreid.data.datasets.bases import ImageDataset
12
+
13
+ __all__ = ['CAVIARa', ]
14
+
15
+
16
+ @DATASET_REGISTRY.register()
17
+ class CAVIARa(ImageDataset):
18
+ """CAVIARa
19
+ """
20
+ dataset_dir = "CAVIARa"
21
+ dataset_name = "caviara"
22
+
23
+ def __init__(self, root='datasets', **kwargs):
24
+ self.root = root
25
+ self.train_path = os.path.join(self.root, self.dataset_dir)
26
+
27
+ required_files = [self.train_path]
28
+ self.check_before_run(required_files)
29
+
30
+ train = self.process_train(self.train_path)
31
+
32
+ super().__init__(train, [], [], **kwargs)
33
+
34
+ def process_train(self, train_path):
35
+ data = []
36
+
37
+ img_list = glob(os.path.join(train_path, "*.jpg"))
38
+ for img_path in img_list:
39
+ img_name = img_path.split('/')[-1]
40
+ pid = self.dataset_name + "_" + img_name[:4]
41
+ camid = self.dataset_name + "_cam0"
42
+ data.append([img_path, pid, camid])
43
+
44
+ return data