dnt 0.2.4__py3-none-any.whl → 0.3.1.3__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.
Potentially problematic release.
This version of dnt might be problematic. Click here for more details.
- dnt/__init__.py +3 -2
- dnt/analysis/__init__.py +3 -2
- dnt/analysis/interaction.py +503 -0
- dnt/analysis/stop.py +22 -17
- dnt/analysis/stop2.py +289 -0
- dnt/analysis/stop3.py +754 -0
- dnt/detect/signal/detector.py +317 -0
- dnt/detect/yolov8/detector.py +116 -16
- dnt/engine/__init__.py +8 -0
- dnt/engine/bbox_interp.py +83 -0
- dnt/engine/bbox_iou.py +20 -0
- dnt/engine/cluster.py +31 -0
- dnt/engine/iob.py +66 -0
- dnt/filter/filter.py +321 -1
- dnt/label/labeler.py +4 -4
- dnt/label/labeler2.py +502 -0
- dnt/shared/__init__.py +2 -1
- dnt/shared/data/coco.names +0 -0
- dnt/shared/data/openimages.names +0 -0
- dnt/shared/data/voc.names +0 -0
- dnt/shared/download.py +12 -0
- dnt/shared/synhcro.py +150 -0
- dnt/shared/util.py +17 -4
- dnt/third_party/fast-reid/__init__.py +1 -0
- dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
- dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
- dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
- dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
- dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
- dnt/third_party/fast-reid/configs/__init__.py +0 -0
- dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
- dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
- dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
- dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
- dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
- dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
- dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
- dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
- dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
- dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
- dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
- dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
- dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
- dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
- dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
- dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
- dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
- dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
- dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
- dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
- dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
- dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
- dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
- dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
- dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
- dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
- dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
- dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
- dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
- dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
- dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
- dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
- dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
- dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
- dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
- dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
- dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
- dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
- dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
- dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
- dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
- dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
- dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
- dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
- dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
- dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
- dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
- dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
- dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
- dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
- dnt/track/__init__.py +2 -0
- dnt/track/botsort/__init__.py +4 -0
- dnt/track/botsort/bot_tracker/__init__.py +3 -0
- dnt/track/botsort/bot_tracker/basetrack.py +60 -0
- dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
- dnt/track/botsort/bot_tracker/gmc.py +316 -0
- dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
- dnt/track/botsort/bot_tracker/matching.py +194 -0
- dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/io.py +19 -36
- dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
- dnt/track/botsort/inference.py +96 -0
- dnt/track/config.py +120 -0
- dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
- dnt/track/dsort/configs/deep_sort.yaml +0 -0
- dnt/track/dsort/configs/fastreid.yaml +1 -1
- dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
- dnt/track/dsort/deep_sort/deep/feature_extractor.py +87 -8
- dnt/track/dsort/deep_sort/deep_sort.py +28 -18
- dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
- dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
- dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
- dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
- dnt/track/dsort/dsort.py +21 -28
- dnt/track/re_class.py +94 -0
- dnt/track/sort/sort.py +5 -1
- dnt/track/tracker.py +207 -30
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/METADATA +30 -10
- dnt-0.3.1.3.dist-info/RECORD +314 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/WHEEL +1 -1
- dnt/analysis/yield.py +0 -9
- dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
- dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
- dnt/track/dsort/deep_sort/deep/test.py +0 -77
- dnt/track/dsort/deep_sort/deep/train.py +0 -189
- dnt/track/dsort/utils/asserts.py +0 -13
- dnt/track/dsort/utils/draw.py +0 -36
- dnt/track/dsort/utils/json_logger.py +0 -383
- dnt/track/dsort/utils/log.py +0 -17
- dnt/track/dsort/utils/parser.py +0 -35
- dnt/track/dsort/utils/tools.py +0 -39
- dnt-0.2.4.dist-info/RECORD +0 -64
- /dnt/{track/dsort/utils → third_party/fast-reid/checkpoint}/__init__.py +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/LICENSE +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/top_level.txt +0 -0
dnt/analysis/stop2.py
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
from shapely.geometry import Point, Polygon, LineString, box
|
|
2
|
+
import geopandas as gpd, pandas as pd
|
|
3
|
+
import datetime
|
|
4
|
+
from tqdm import tqdm
|
|
5
|
+
|
|
6
|
+
class StopAnalyzer():
|
|
7
|
+
def __init__(self,
|
|
8
|
+
hzones: list[Polygon] = [],
|
|
9
|
+
vzones: list[Polygon] = [],
|
|
10
|
+
event_dict:dict[int, list[int]] = {},
|
|
11
|
+
stop_iou:float=0.97,
|
|
12
|
+
frame_buffer:int=5,
|
|
13
|
+
verbose:bool=True):
|
|
14
|
+
|
|
15
|
+
self.hzones = hzones
|
|
16
|
+
self.vzones = vzones
|
|
17
|
+
self.event_dict = event_dict
|
|
18
|
+
self.stop_iou = stop_iou
|
|
19
|
+
self.frame_buffer = frame_buffer
|
|
20
|
+
self.verbose = verbose
|
|
21
|
+
|
|
22
|
+
def analyze(self, tracks:pd.DataFrame=None, track_file:str=None,video_index:int=None, video_tot:int=None)->list[pd.DataFrame, pd.DataFrame]:
|
|
23
|
+
|
|
24
|
+
if tracks is None:
|
|
25
|
+
tracks = pd.read_csv(track_file, header=None)
|
|
26
|
+
tracks = StopAnalyzer.add_field_names(tracks)
|
|
27
|
+
|
|
28
|
+
tracks = self.scan_stop(tracks, video_index, video_tot)
|
|
29
|
+
tracks = self.identify_event(tracks, video_index, video_tot)
|
|
30
|
+
events = self.count_event(tracks, video_index, video_tot)
|
|
31
|
+
|
|
32
|
+
return tracks, events
|
|
33
|
+
|
|
34
|
+
def scan_stop(self, tracks:pd.DataFrame, video_index:int=None, video_tot:int=None)->pd.DataFrame:
|
|
35
|
+
|
|
36
|
+
ids = tracks['track'].unique()
|
|
37
|
+
tracks['hzone'] = -1
|
|
38
|
+
|
|
39
|
+
pbar = tqdm(total=len(ids), unit=' tracks')
|
|
40
|
+
if video_index and video_tot:
|
|
41
|
+
pbar.set_description_str("Scanning stops {} of {}".format(video_index, video_tot))
|
|
42
|
+
else:
|
|
43
|
+
pbar.set_description_str("Scanning stops")
|
|
44
|
+
|
|
45
|
+
for id in ids:
|
|
46
|
+
track = tracks[tracks['track'] == id].sort_values(by='frame') # sort by frame in ascending
|
|
47
|
+
|
|
48
|
+
for i in range(self.frame_buffer, len(track)):
|
|
49
|
+
index = track.iloc[i].name
|
|
50
|
+
bb0 = [track.iloc[i-self.frame_buffer]['x'], track.iloc[i-self.frame_buffer]['y'],
|
|
51
|
+
track.iloc[i-self.frame_buffer]['w'], track.iloc[i-self.frame_buffer]['h']]
|
|
52
|
+
bb1 = [track.iloc[i]['x'], track.iloc[i]['y'], track.iloc[i]['w'], track.iloc[i]['h']]
|
|
53
|
+
iou_score = StopAnalyzer.iou(bb0, bb1)
|
|
54
|
+
|
|
55
|
+
tracks.at[index, 'iou'] = iou_score
|
|
56
|
+
if iou_score >= self.stop_iou:
|
|
57
|
+
tracks.at[index, 'stop'] = 1
|
|
58
|
+
|
|
59
|
+
if len(self.vzones)>0:
|
|
60
|
+
center = Point(track.iloc[i]['x']+track.iloc[i]['w'], track.iloc[i]['y']+track.iloc[i]['h'])
|
|
61
|
+
for j in range(len(self.vzones)):
|
|
62
|
+
if center.within(self.vzones[j]):
|
|
63
|
+
tracks.loc[tracks['track']==id, 'vzone']=j
|
|
64
|
+
break
|
|
65
|
+
|
|
66
|
+
if len(self.hzones)>0:
|
|
67
|
+
bb = box(track.iloc[i]['x'], track.iloc[i]['y'], track.iloc[i]['x']
|
|
68
|
+
+ track.iloc[i]['w'], track.iloc[i]['y'] + track.iloc[i]['h'])
|
|
69
|
+
for j in range(len(self.hzones)):
|
|
70
|
+
if bb.intersects(self.hzones[j]):
|
|
71
|
+
if j > tracks.at[index, 'hzone']:
|
|
72
|
+
tracks.at[index, 'hzone'] = j
|
|
73
|
+
|
|
74
|
+
if self.verbose:
|
|
75
|
+
pbar.update()
|
|
76
|
+
|
|
77
|
+
pbar.close()
|
|
78
|
+
return tracks
|
|
79
|
+
|
|
80
|
+
def identify_event(self, tracks:pd.DataFrame, video_index:int=None, video_tot:int=None)->pd.DataFrame:
|
|
81
|
+
|
|
82
|
+
pbar = tqdm(total=len(tracks), unit=' frames')
|
|
83
|
+
if video_index and video_tot:
|
|
84
|
+
pbar.set_description_str("Identifying events {} of {}".format(video_index, video_tot))
|
|
85
|
+
else:
|
|
86
|
+
pbar.set_description_str("Identifying events")
|
|
87
|
+
|
|
88
|
+
for i in range(len(tracks)):
|
|
89
|
+
|
|
90
|
+
if tracks.iloc[i]['stop'] == 1:
|
|
91
|
+
vzone = tracks.iloc[i]['vzone']
|
|
92
|
+
hzone = tracks.iloc[i]['hzone']
|
|
93
|
+
frame = tracks.iloc[i]['frame']
|
|
94
|
+
id = tracks.iloc[i]['track']
|
|
95
|
+
vehs_inlane = tracks.loc[(tracks['frame']==frame) & (tracks['track']!=id) & (tracks['vzone']==vzone) & (tracks['hzone']>hzone)]
|
|
96
|
+
|
|
97
|
+
if len(vehs_inlane)==0:
|
|
98
|
+
pre_key = -1
|
|
99
|
+
for key in self.event_dict:
|
|
100
|
+
if key >= pre_key:
|
|
101
|
+
pre_key = key
|
|
102
|
+
if tracks.iloc[i]['hzone'] in self.event_dict[key]:
|
|
103
|
+
tracks.at[i, 'event'] = key
|
|
104
|
+
|
|
105
|
+
if self.verbose:
|
|
106
|
+
pbar.update()
|
|
107
|
+
|
|
108
|
+
pbar.close()
|
|
109
|
+
|
|
110
|
+
return tracks
|
|
111
|
+
|
|
112
|
+
def count_event(self, tracks:pd.DataFrame, video_index:int=None, video_tot:int=None)->pd.DataFrame:
|
|
113
|
+
|
|
114
|
+
pbar = tqdm(unit='events')
|
|
115
|
+
results = []
|
|
116
|
+
for key in self.event_dict:
|
|
117
|
+
|
|
118
|
+
vehicles = tracks.loc[tracks['event']==key]['track'].unique()
|
|
119
|
+
|
|
120
|
+
if video_index and video_tot:
|
|
121
|
+
pbar.set_description_str("Counting event {} for {} of {}".format(key, video_index, video_tot))
|
|
122
|
+
else:
|
|
123
|
+
pbar.set_description_str("Counting event {}".format(key))
|
|
124
|
+
|
|
125
|
+
pbar.total = len(vehicles)
|
|
126
|
+
for vehicle in vehicles:
|
|
127
|
+
|
|
128
|
+
track = tracks[(tracks['track'] == vehicle) & (tracks['event'] == key)]
|
|
129
|
+
|
|
130
|
+
start_frame = int(track['frame'].min())
|
|
131
|
+
end_frame = int(track['frame'].max())
|
|
132
|
+
vzone = track['vzone'].mode()[0]
|
|
133
|
+
results.append([key, vehicle, vzone, start_frame, end_frame])
|
|
134
|
+
|
|
135
|
+
if self.verbose:
|
|
136
|
+
pbar.update()
|
|
137
|
+
|
|
138
|
+
results = pd.DataFrame(results, columns=['event', 'track', 'vzone', 'start_frame', 'end_frame'])
|
|
139
|
+
pbar.close()
|
|
140
|
+
|
|
141
|
+
return results
|
|
142
|
+
|
|
143
|
+
def generate_labels(self, tracks:pd.DataFrame, events:pd.DataFrame, video_index:int=None, video_tot:int=None)->pd.DataFrame:
|
|
144
|
+
|
|
145
|
+
event_tracks = tracks.loc[tracks['event']>-1].copy()
|
|
146
|
+
for index, event in events.iterrows():
|
|
147
|
+
track_id = event['track']
|
|
148
|
+
start_frame = event['start_frame']
|
|
149
|
+
end_frame = event['end_frame']
|
|
150
|
+
event_id = event['event']
|
|
151
|
+
|
|
152
|
+
event_tracks.loc[(event_tracks['track']==track_id) & (event_tracks['frame']>=start_frame)
|
|
153
|
+
& (event_tracks['frame']<=end_frame), 'event'] = event_id
|
|
154
|
+
|
|
155
|
+
pbar = tqdm(total= len(event_tracks))
|
|
156
|
+
if video_index and video_tot:
|
|
157
|
+
pbar.set_description_str("Generating labeles for {} of {}".format(video_index, video_tot))
|
|
158
|
+
else:
|
|
159
|
+
pbar.set_description_str("Generating labels")
|
|
160
|
+
|
|
161
|
+
results = []
|
|
162
|
+
for index, track in event_tracks.iterrows():
|
|
163
|
+
desc = 'Stop'
|
|
164
|
+
if track['event'] == 1:
|
|
165
|
+
desc = 'Pass'
|
|
166
|
+
elif track['event'] == 2:
|
|
167
|
+
desc = 'Invading'
|
|
168
|
+
|
|
169
|
+
results.append([track['frame'], 'bbox', [(track['x'], track['y']), (track['x']+track['w'], track['y']+track['h'])],
|
|
170
|
+
(0, 255,0), 1, 1, desc])
|
|
171
|
+
|
|
172
|
+
if self.verbose:
|
|
173
|
+
pbar.update()
|
|
174
|
+
|
|
175
|
+
df = pd.DataFrame(results, columns=['frame','type','coords','color','size','thick','desc'])
|
|
176
|
+
df.sort_values(by='frame')
|
|
177
|
+
|
|
178
|
+
return df
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@staticmethod
|
|
182
|
+
def add_field_names(tracks: pd.DataFrame)->pd.DataFrame:
|
|
183
|
+
if len(tracks.columns)!=10:
|
|
184
|
+
raise Exception('The number of fields is not nine.')
|
|
185
|
+
tracks.columns = ['frame', 'track', 'x', 'y', 'w', 'h', 'score', 'cls', 'r3','r4']
|
|
186
|
+
tracks['iou'] = -1.0
|
|
187
|
+
tracks['stop'] = -1
|
|
188
|
+
tracks['vzone'] = -1
|
|
189
|
+
tracks['hzone'] = -1
|
|
190
|
+
tracks['event'] = -1
|
|
191
|
+
return tracks
|
|
192
|
+
|
|
193
|
+
@staticmethod
|
|
194
|
+
def iou(bb1:tuple[int, int, int, int], bb2:tuple[int, int, int, int]):
|
|
195
|
+
"""
|
|
196
|
+
Calculate the Intersection over Union (IoU) of two bounding boxes.
|
|
197
|
+
Parameters
|
|
198
|
+
----------
|
|
199
|
+
bb1 : [x1, y1, w, h]
|
|
200
|
+
x1, y1 - top left corner
|
|
201
|
+
w, h - width and height
|
|
202
|
+
bb2 : [x1, y1, w, h]
|
|
203
|
+
x1, y1 - top left corner
|
|
204
|
+
w, h - width and height
|
|
205
|
+
Returns
|
|
206
|
+
-------
|
|
207
|
+
iou: float [0, 1]
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
assert bb1[0] < bb1[0] + bb1[2]
|
|
211
|
+
assert bb1[1] < bb1[1] + bb1[3]
|
|
212
|
+
assert bb2[0] < bb2[0] + bb2[2]
|
|
213
|
+
assert bb2[1] < bb2[1] + bb2[3]
|
|
214
|
+
|
|
215
|
+
# determine the coordinates of the intersection rectangle
|
|
216
|
+
x_left = max(bb1[0], bb2[0])
|
|
217
|
+
y_top = max(bb1[1], bb2[1])
|
|
218
|
+
x_right = min(bb1[0]+bb1[2], bb2[0]+bb2[2])
|
|
219
|
+
y_bottom = min(bb1[1]+bb1[3], bb2[1]+bb2[3])
|
|
220
|
+
|
|
221
|
+
if x_right < x_left or y_bottom < y_top:
|
|
222
|
+
return 0.0
|
|
223
|
+
|
|
224
|
+
# The intersection of two axis-aligned bounding boxes is always an
|
|
225
|
+
# axis-aligned bounding box
|
|
226
|
+
intersection_area = (x_right - x_left) * (y_bottom - y_top)
|
|
227
|
+
|
|
228
|
+
# compute the area of both AABBs
|
|
229
|
+
bb1_area = bb1[2] * bb1[3]
|
|
230
|
+
bb2_area = bb2[2] * bb2[3]
|
|
231
|
+
|
|
232
|
+
# compute the intersection over union by taking the intersection
|
|
233
|
+
# area and dividing it by the sum of prediction + ground-truth
|
|
234
|
+
# areas - the interesection area
|
|
235
|
+
iou = intersection_area / float(bb1_area + bb2_area - intersection_area)
|
|
236
|
+
assert iou >= 0.0
|
|
237
|
+
assert iou <= 1.0
|
|
238
|
+
return iou
|
|
239
|
+
|
|
240
|
+
@staticmethod
|
|
241
|
+
def gen_zones(line_coords:list[list[tuple[int, int], tuple[int, int]]])->list[Polygon]:
|
|
242
|
+
"""
|
|
243
|
+
Generate a list of shapely polygons
|
|
244
|
+
Inputs:
|
|
245
|
+
line_coords: a list of line coords ([[(x11, y11),(x12, y12)], [(x21, y21),(x22, y22)], ...])
|
|
246
|
+
Returns:
|
|
247
|
+
A list of PloyGons
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
zones = []
|
|
251
|
+
for i in range(1, len(line_coords)):
|
|
252
|
+
shell = line_coords[i-1] + [line_coords[i][1], line_coords[i][0]]
|
|
253
|
+
zones.append(Polygon(shell))
|
|
254
|
+
|
|
255
|
+
return zones
|
|
256
|
+
|
|
257
|
+
if __name__=='__main__':
|
|
258
|
+
track_file = '/mnt/d/videos/ped2stage/tracks/gh021291_track_veh.txt'
|
|
259
|
+
tracks = pd.read_csv(track_file, header=None)
|
|
260
|
+
tracks['r1'] = -1
|
|
261
|
+
tracks['r2'] = -1
|
|
262
|
+
tracks['r3'] = -1
|
|
263
|
+
tracks = StopAnalyzer.add_field_names(tracks)
|
|
264
|
+
|
|
265
|
+
v_coords = []
|
|
266
|
+
h_coords = [[(194, 769),(480, 484)],
|
|
267
|
+
[(550, 812),(767, 487)],
|
|
268
|
+
[(677, 835),(824, 484)],
|
|
269
|
+
[(1087, 870),(958, 483)]]
|
|
270
|
+
hzones = StopAnalyzer.gen_zones(h_coords)
|
|
271
|
+
|
|
272
|
+
event_dict = {
|
|
273
|
+
0: [0], # Stop before stop bar
|
|
274
|
+
1: [1], # Pass stop bar
|
|
275
|
+
2: [2] # Invading crosswalk
|
|
276
|
+
}
|
|
277
|
+
analyzer = StopAnalyzer(hzones=hzones, event_dict=event_dict)
|
|
278
|
+
|
|
279
|
+
tracks_stop = analyzer.scan_stop(tracks)
|
|
280
|
+
tracks_event = analyzer.identify_event(tracks_stop)
|
|
281
|
+
tracks_event.to_csv('/mnt/d/videos/ped2stage/stop/gh021291_track_veh_stop.txt', index=False)
|
|
282
|
+
|
|
283
|
+
event_count = analyzer.count_event(tracks_event)
|
|
284
|
+
event_count.to_csv('/mnt/d/videos/ped2stage/stop/gh021291_track_stops_count.txt', index=False)
|
|
285
|
+
|
|
286
|
+
labels = analyzer.generate_labels(tracks_event, event_count)
|
|
287
|
+
labels.to_csv('/mnt/d/videos/ped2stage/stop/gh021291_track_stops_label.txt', index=False)
|
|
288
|
+
|
|
289
|
+
|