dnt 0.2.4__tar.gz → 0.3.1.7__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.
- dnt-0.3.1.7/MANIFEST.in +6 -0
- {dnt-0.2.4/dnt.egg-info → dnt-0.3.1.7}/PKG-INFO +38 -11
- {dnt-0.2.4 → dnt-0.3.1.7}/README.md +6 -1
- dnt-0.3.1.7/dnt/__init__.py +5 -0
- dnt-0.3.1.7/dnt/analysis/__init__.py +8 -0
- dnt-0.3.1.7/dnt/analysis/count.py +107 -0
- dnt-0.3.1.7/dnt/analysis/interaction2.py +518 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/analysis/speed.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/analysis/stop.py +22 -17
- dnt-0.3.1.7/dnt/analysis/stop2.py +289 -0
- dnt-0.3.1.7/dnt/analysis/stop3.py +758 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/detect/__init__.py +0 -0
- dnt-0.3.1.7/dnt/detect/signal/detector.py +326 -0
- dnt-0.3.1.7/dnt/detect/timestamp.py +105 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/detect/yolov8/__init__.py +0 -0
- dnt-0.3.1.7/dnt/detect/yolov8/detector.py +319 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/detect/yolov8/segmentor.py +60 -2
- dnt-0.3.1.7/dnt/engine/__init__.py +8 -0
- dnt-0.3.1.7/dnt/engine/bbox_interp.py +83 -0
- dnt-0.3.1.7/dnt/engine/bbox_iou.py +20 -0
- dnt-0.3.1.7/dnt/engine/cluster.py +31 -0
- dnt-0.3.1.7/dnt/engine/iob.py +66 -0
- dnt-0.3.1.7/dnt/filter/filter.py +466 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/label/__init__.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/label/labeler.py +4 -4
- dnt-0.3.1.7/dnt/label/labeler2.py +605 -0
- {dnt-0.2.4/dnt/analysis → dnt-0.3.1.7/dnt/shared}/__init__.py +1 -3
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/convert.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/data/coco.names +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/data/openimages.names +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/data/voc.names +0 -0
- dnt-0.3.1.7/dnt/shared/download.py +12 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/files.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/filter.py +0 -0
- dnt-0.3.1.7/dnt/shared/synhcro.py +150 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/shared/util.py +17 -4
- dnt-0.3.1.7/dnt/third_party/fast-reid/__init__.py +1 -0
- {dnt-0.2.4/dnt/track/dsort/deep_sort/deep → dnt-0.3.1.7/dnt/third_party/fast-reid/checkpoint}/__init__.py +0 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
- {dnt-0.2.4/dnt/track/dsort/deep_sort/sort → dnt-0.3.1.7/dnt/third_party/fast-reid/configs}/__init__.py +0 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
- dnt-0.3.1.7/dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/__init__.py +2 -0
- {dnt-0.2.4/dnt → dnt-0.3.1.7/dnt/track/botsort}/__init__.py +1 -1
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/__init__.py +3 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/basetrack.py +60 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/gmc.py +316 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/matching.py +194 -0
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
- {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.7/dnt/track/botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
- {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.7/dnt/track/botsort/bot_tracker/tracking_utils}/io.py +19 -36
- dnt-0.3.1.7/dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
- dnt-0.3.1.7/dnt/track/botsort/inference.py +96 -0
- dnt-0.3.1.7/dnt/track/config.py +120 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/__init__.py +0 -0
- dnt-0.3.1.7/dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/configs/deep_sort.yaml +0 -0
- dnt-0.3.1.7/dnt/track/dsort/configs/fastreid.yaml +3 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/__init__.py +0 -0
- {dnt-0.2.4/dnt/track/dsort/utils → dnt-0.3.1.7/dnt/track/dsort/deep_sort/deep}/__init__.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
- dnt-0.3.1.7/dnt/track/dsort/deep_sort/deep/feature_extractor.py +134 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/deep/model.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/deep_sort.py +31 -20
- dnt-0.3.1.7/dnt/track/dsort/deep_sort/sort/__init__.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/detection.py +2 -1
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/kalman_filter.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/track.py +2 -1
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/dsort/deep_sort/sort/tracker.py +1 -1
- dnt-0.3.1.7/dnt/track/dsort/dsort.py +96 -0
- dnt-0.3.1.7/dnt/track/re_class.py +117 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/sort/__init__.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/track/sort/sort.py +9 -6
- dnt-0.3.1.7/dnt/track/tracker.py +261 -0
- {dnt-0.2.4 → dnt-0.3.1.7/dnt.egg-info}/PKG-INFO +38 -11
- dnt-0.3.1.7/dnt.egg-info/SOURCES.txt +319 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt.egg-info/requires.txt +26 -9
- {dnt-0.2.4 → dnt-0.3.1.7}/setup.py +28 -11
- dnt-0.2.4/MANIFEST.in +0 -4
- dnt-0.2.4/dnt/analysis/count.py +0 -90
- dnt-0.2.4/dnt/analysis/yield.py +0 -9
- dnt-0.2.4/dnt/detect/yolov8/detector.py +0 -176
- dnt-0.2.4/dnt/filter/filter.py +0 -135
- dnt-0.2.4/dnt/shared/__init__.py +0 -4
- dnt-0.2.4/dnt/track/dsort/configs/fastreid.yaml +0 -3
- dnt-0.2.4/dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
- dnt-0.2.4/dnt/track/dsort/deep_sort/deep/feature_extractor.py +0 -55
- dnt-0.2.4/dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
- dnt-0.2.4/dnt/track/dsort/deep_sort/deep/test.py +0 -77
- dnt-0.2.4/dnt/track/dsort/deep_sort/deep/train.py +0 -189
- dnt-0.2.4/dnt/track/dsort/dsort.py +0 -86
- dnt-0.2.4/dnt/track/dsort/utils/asserts.py +0 -13
- dnt-0.2.4/dnt/track/dsort/utils/draw.py +0 -36
- dnt-0.2.4/dnt/track/dsort/utils/json_logger.py +0 -383
- dnt-0.2.4/dnt/track/dsort/utils/log.py +0 -17
- dnt-0.2.4/dnt/track/dsort/utils/parser.py +0 -35
- dnt-0.2.4/dnt/track/dsort/utils/tools.py +0 -39
- dnt-0.2.4/dnt/track/tracker.py +0 -80
- dnt-0.2.4/dnt.egg-info/SOURCES.txt +0 -68
- {dnt-0.2.4 → dnt-0.3.1.7}/LICENSE +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/analysis/position.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt/filter/__init__.py +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt.egg-info/dependency_links.txt +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/dnt.egg-info/top_level.txt +0 -0
- {dnt-0.2.4 → dnt-0.3.1.7}/setup.cfg +0 -0
dnt-0.3.1.7/MANIFEST.in
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dnt
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1.7
|
|
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,51 @@ 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
24
|
Requires-Dist: filterpy
|
|
25
|
+
Requires-Dist: gdown
|
|
26
|
+
Requires-Dist: geopandas
|
|
27
|
+
Requires-Dist: h5py
|
|
28
|
+
Requires-Dist: lapx
|
|
29
|
+
Requires-Dist: loguru
|
|
25
30
|
Requires-Dist: matplotlib
|
|
31
|
+
Requires-Dist: motmetrics
|
|
32
|
+
Requires-Dist: ninja
|
|
33
|
+
Requires-Dist: numpy
|
|
26
34
|
Requires-Dist: numpy_indexed
|
|
27
|
-
Requires-Dist: opencv-python
|
|
28
35
|
Requires-Dist: opencv-contrib-python
|
|
36
|
+
Requires-Dist: opencv-python
|
|
29
37
|
Requires-Dist: pandas
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
38
|
+
Requires-Dist: Pillow
|
|
39
|
+
Requires-Dist: prettytable
|
|
40
|
+
Requires-Dist: pycocotools
|
|
41
|
+
Requires-Dist: pyyaml
|
|
34
42
|
Requires-Dist: scikit-image
|
|
43
|
+
Requires-Dist: scikit-learn
|
|
44
|
+
Requires-Dist: scipy
|
|
45
|
+
Requires-Dist: shapely
|
|
46
|
+
Requires-Dist: sympy
|
|
47
|
+
Requires-Dist: tabulate
|
|
48
|
+
Requires-Dist: tensorboard
|
|
49
|
+
Requires-Dist: termcolor
|
|
50
|
+
Requires-Dist: thop
|
|
35
51
|
Requires-Dist: tqdm
|
|
36
52
|
Requires-Dist: vidgear
|
|
53
|
+
Requires-Dist: yacs
|
|
54
|
+
Dynamic: author
|
|
55
|
+
Dynamic: author-email
|
|
56
|
+
Dynamic: classifier
|
|
57
|
+
Dynamic: home-page
|
|
58
|
+
Dynamic: keywords
|
|
59
|
+
Dynamic: license
|
|
60
|
+
Dynamic: license-file
|
|
61
|
+
Dynamic: requires-dist
|
|
62
|
+
Dynamic: requires-python
|
|
63
|
+
Dynamic: summary
|
|
@@ -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,107 @@
|
|
|
1
|
+
# pylint: disable=too-many-arguments
|
|
2
|
+
'''
|
|
3
|
+
This script is used to count the number of tracks that passing a reference line for post-analysis
|
|
4
|
+
last modified: 2021-09-30
|
|
5
|
+
'''
|
|
6
|
+
from shapely.geometry import Polygon, LineString
|
|
7
|
+
import geopandas as gpd
|
|
8
|
+
import pandas as pd
|
|
9
|
+
from tqdm import tqdm
|
|
10
|
+
import numpy as np
|
|
11
|
+
|
|
12
|
+
class Count:
|
|
13
|
+
'''
|
|
14
|
+
Count tracks that passing a reference line for post-analysis
|
|
15
|
+
Methods:
|
|
16
|
+
__init__(): initialize the class
|
|
17
|
+
count_tracks_by_line():
|
|
18
|
+
count tracks that passing a reference line for post-analysis
|
|
19
|
+
'''
|
|
20
|
+
def __init__(self) -> None:
|
|
21
|
+
self.track_fields = ['frame', 'track_id', 'x', 'y', 'w', 'h', 'r1', 'r2', 'r3', 'r4']
|
|
22
|
+
|
|
23
|
+
def count_tracks_by_line(self,
|
|
24
|
+
tracks:pd.DataFrame=None,
|
|
25
|
+
track_file:str=None,
|
|
26
|
+
line: LineString=None,
|
|
27
|
+
video_index:int=None,
|
|
28
|
+
video_tot:int=None,
|
|
29
|
+
verbose:bool=True) -> pd.DataFrame:
|
|
30
|
+
'''
|
|
31
|
+
Count tracks that passing a reference line for post-analysis
|
|
32
|
+
Inputs:
|
|
33
|
+
tracks - a DataFrame of tracks, if None (default), read track_file
|
|
34
|
+
track_file - a txt file contains tracks,
|
|
35
|
+
line - the reference line, LineString(pointA, pointB)
|
|
36
|
+
video_index - the index of video for processing
|
|
37
|
+
video_tot - the total number of videos
|
|
38
|
+
verbose - if True, show progress bar
|
|
39
|
+
Return:
|
|
40
|
+
A DataFrame of track_id, frame, direction, count
|
|
41
|
+
'''
|
|
42
|
+
# Load tracks
|
|
43
|
+
if tracks is None:
|
|
44
|
+
tracks = pd.read_csv(track_file, header=None)
|
|
45
|
+
if len(tracks.columns) != len(self.track_fields):
|
|
46
|
+
raise Exception("The tracks format is incorrect!")
|
|
47
|
+
tracks.columns = self.track_fields
|
|
48
|
+
track_ids = tracks['track_id'].unique()
|
|
49
|
+
|
|
50
|
+
# Create a GeoDataFrame of tracks
|
|
51
|
+
geo = tracks.apply(lambda track: Polygon([(track['x'], track['y']),
|
|
52
|
+
(track['x'] + track['w'], track['y']),
|
|
53
|
+
(track['x'] + track['w'], track['y'] + track['h']),
|
|
54
|
+
(track['x'], track['y'] + track['h'])]),
|
|
55
|
+
axis =1)
|
|
56
|
+
geo_tracks = gpd.GeoDataFrame(tracks, geometry=geo)
|
|
57
|
+
point_a = np.array(line.coords[0])
|
|
58
|
+
point_b = np.array(line.coords[1])
|
|
59
|
+
|
|
60
|
+
# Interate through all tracks
|
|
61
|
+
if verbose:
|
|
62
|
+
pbar = tqdm(total=len(track_ids), unit=' tracks')
|
|
63
|
+
if video_index and video_tot:
|
|
64
|
+
pbar.set_description_str("Counting {} of {}".format(video_index, video_tot))
|
|
65
|
+
else:
|
|
66
|
+
pbar.set_description_str("Counting")
|
|
67
|
+
intersected_tracks = []
|
|
68
|
+
intersected_frames = []
|
|
69
|
+
intersected_direct = []
|
|
70
|
+
|
|
71
|
+
for track_id in track_ids:
|
|
72
|
+
selected = geo_tracks.loc[(geo_tracks['track_id']==track_id)].copy()
|
|
73
|
+
if len(selected)>0:
|
|
74
|
+
selected['intersected'] = line.intersects(selected.geometry).values.tolist()
|
|
75
|
+
intersected = selected.loc[(selected['intersected']==True)].copy()
|
|
76
|
+
if len(intersected) > 0:
|
|
77
|
+
intersected.sort_values(by='frame', inplace=True)
|
|
78
|
+
if not track_id in intersected_tracks:
|
|
79
|
+
intersected_tracks.append(track_id)
|
|
80
|
+
frame_pos = int(len(intersected)/2)
|
|
81
|
+
intersected_frames.append(intersected['frame'].values[frame_pos])
|
|
82
|
+
|
|
83
|
+
# center point of the first frame
|
|
84
|
+
point_c = np.array((intersected.iloc[0]['x'] + intersected.iloc[0]['w']/2,
|
|
85
|
+
intersected.iloc[0]['y'] + intersected.iloc[0]['h']/2))
|
|
86
|
+
d = 2 # right
|
|
87
|
+
if np.cross(point_c-point_a, point_b-point_a) < 0:
|
|
88
|
+
d = 1 # left
|
|
89
|
+
intersected_direct.append(d)
|
|
90
|
+
if verbose:
|
|
91
|
+
pbar.update()
|
|
92
|
+
|
|
93
|
+
if verbose:
|
|
94
|
+
pbar.close()
|
|
95
|
+
|
|
96
|
+
results = pd.DataFrame(
|
|
97
|
+
{
|
|
98
|
+
'track_id': intersected_tracks,
|
|
99
|
+
'frame': intersected_frames,
|
|
100
|
+
'direction': intersected_direct,
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
results.sort_values(by='frame', inplace=True)
|
|
104
|
+
results = results.reset_index(drop=True)
|
|
105
|
+
results['count'] = results.index + 1
|
|
106
|
+
|
|
107
|
+
return results
|