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.
- dnt/__init__.py +3 -2
- dnt/analysis/__init__.py +3 -2
- dnt/analysis/count.py +54 -37
- dnt/analysis/interaction2.py +518 -0
- dnt/analysis/stop.py +22 -17
- dnt/analysis/stop2.py +289 -0
- dnt/analysis/stop3.py +758 -0
- dnt/detect/signal/detector.py +326 -0
- dnt/detect/timestamp.py +105 -0
- dnt/detect/yolov8/detector.py +179 -36
- dnt/detect/yolov8/segmentor.py +60 -2
- 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 +333 -2
- dnt/label/labeler.py +4 -4
- dnt/label/labeler2.py +631 -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 +31 -20
- dnt/track/dsort/deep_sort/sort/detection.py +2 -1
- 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/deep_sort/sort/track.py +2 -1
- dnt/track/dsort/deep_sort/sort/tracker.py +1 -1
- dnt/track/dsort/dsort.py +43 -33
- dnt/track/re_class.py +117 -0
- dnt/track/sort/sort.py +9 -6
- dnt/track/tracker.py +213 -32
- dnt-0.3.1.8.dist-info/METADATA +117 -0
- dnt-0.3.1.8.dist-info/RECORD +315 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.8.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/METADATA +0 -35
- 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.8.dist-info/licenses}/LICENSE +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: liaoxingyu
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import pickle
|
|
9
|
+
import random
|
|
10
|
+
|
|
11
|
+
import matplotlib.pyplot as plt
|
|
12
|
+
import numpy as np
|
|
13
|
+
import tqdm
|
|
14
|
+
from scipy.stats import norm
|
|
15
|
+
from sklearn import metrics
|
|
16
|
+
|
|
17
|
+
from .file_io import PathManager
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Visualizer:
|
|
21
|
+
r"""Visualize images(activation map) ranking list of features generated by reid models."""
|
|
22
|
+
|
|
23
|
+
def __init__(self, dataset):
|
|
24
|
+
self.dataset = dataset
|
|
25
|
+
|
|
26
|
+
def get_model_output(self, all_ap, dist, q_pids, g_pids, q_camids, g_camids):
|
|
27
|
+
self.all_ap = all_ap
|
|
28
|
+
self.dist = dist
|
|
29
|
+
self.sim = 1 - dist
|
|
30
|
+
self.q_pids = q_pids
|
|
31
|
+
self.g_pids = g_pids
|
|
32
|
+
self.q_camids = q_camids
|
|
33
|
+
self.g_camids = g_camids
|
|
34
|
+
|
|
35
|
+
self.indices = np.argsort(dist, axis=1)
|
|
36
|
+
self.matches = (g_pids[self.indices] == q_pids[:, np.newaxis]).astype(np.int32)
|
|
37
|
+
|
|
38
|
+
self.num_query = len(q_pids)
|
|
39
|
+
|
|
40
|
+
def get_matched_result(self, q_index):
|
|
41
|
+
q_pid = self.q_pids[q_index]
|
|
42
|
+
q_camid = self.q_camids[q_index]
|
|
43
|
+
|
|
44
|
+
order = self.indices[q_index]
|
|
45
|
+
remove = (self.g_pids[order] == q_pid) & (self.g_camids[order] == q_camid)
|
|
46
|
+
keep = np.invert(remove)
|
|
47
|
+
cmc = self.matches[q_index][keep]
|
|
48
|
+
sort_idx = order[keep]
|
|
49
|
+
return cmc, sort_idx
|
|
50
|
+
|
|
51
|
+
def save_rank_result(self, query_indices, output, max_rank=5, vis_label=False, label_sort='ascending',
|
|
52
|
+
actmap=False):
|
|
53
|
+
if vis_label:
|
|
54
|
+
fig, axes = plt.subplots(2, max_rank + 1, figsize=(3 * max_rank, 12))
|
|
55
|
+
else:
|
|
56
|
+
fig, axes = plt.subplots(1, max_rank + 1, figsize=(3 * max_rank, 6))
|
|
57
|
+
for cnt, q_idx in enumerate(tqdm.tqdm(query_indices)):
|
|
58
|
+
all_imgs = []
|
|
59
|
+
cmc, sort_idx = self.get_matched_result(q_idx)
|
|
60
|
+
query_info = self.dataset[q_idx]
|
|
61
|
+
query_img = query_info['images']
|
|
62
|
+
cam_id = query_info['camids']
|
|
63
|
+
query_name = query_info['img_paths'].split('/')[-1]
|
|
64
|
+
all_imgs.append(query_img)
|
|
65
|
+
query_img = np.rollaxis(np.asarray(query_img.numpy(), dtype=np.uint8), 0, 3)
|
|
66
|
+
plt.clf()
|
|
67
|
+
ax = fig.add_subplot(1, max_rank + 1, 1)
|
|
68
|
+
ax.imshow(query_img)
|
|
69
|
+
ax.set_title('{:.4f}/cam{}'.format(self.all_ap[q_idx], cam_id))
|
|
70
|
+
ax.axis("off")
|
|
71
|
+
for i in range(max_rank):
|
|
72
|
+
if vis_label:
|
|
73
|
+
ax = fig.add_subplot(2, max_rank + 1, i + 2)
|
|
74
|
+
else:
|
|
75
|
+
ax = fig.add_subplot(1, max_rank + 1, i + 2)
|
|
76
|
+
g_idx = self.num_query + sort_idx[i]
|
|
77
|
+
gallery_info = self.dataset[g_idx]
|
|
78
|
+
gallery_img = gallery_info['images']
|
|
79
|
+
cam_id = gallery_info['camids']
|
|
80
|
+
all_imgs.append(gallery_img)
|
|
81
|
+
gallery_img = np.rollaxis(np.asarray(gallery_img, dtype=np.uint8), 0, 3)
|
|
82
|
+
if cmc[i] == 1:
|
|
83
|
+
label = 'true'
|
|
84
|
+
ax.add_patch(plt.Rectangle(xy=(0, 0), width=gallery_img.shape[1] - 1,
|
|
85
|
+
height=gallery_img.shape[0] - 1, edgecolor=(1, 0, 0),
|
|
86
|
+
fill=False, linewidth=5))
|
|
87
|
+
else:
|
|
88
|
+
label = 'false'
|
|
89
|
+
ax.add_patch(plt.Rectangle(xy=(0, 0), width=gallery_img.shape[1] - 1,
|
|
90
|
+
height=gallery_img.shape[0] - 1,
|
|
91
|
+
edgecolor=(0, 0, 1), fill=False, linewidth=5))
|
|
92
|
+
ax.imshow(gallery_img)
|
|
93
|
+
ax.set_title(f'{self.sim[q_idx, sort_idx[i]]:.3f}/{label}/cam{cam_id}')
|
|
94
|
+
ax.axis("off")
|
|
95
|
+
# if actmap:
|
|
96
|
+
# act_outputs = []
|
|
97
|
+
#
|
|
98
|
+
# def hook_fns_forward(module, input, output):
|
|
99
|
+
# act_outputs.append(output.cpu())
|
|
100
|
+
#
|
|
101
|
+
# all_imgs = np.stack(all_imgs, axis=0) # (b, 3, h, w)
|
|
102
|
+
# all_imgs = torch.from_numpy(all_imgs).float()
|
|
103
|
+
# # normalize
|
|
104
|
+
# all_imgs = all_imgs.sub_(self.mean).div_(self.std)
|
|
105
|
+
# sz = list(all_imgs.shape[-2:])
|
|
106
|
+
# handle = m.base.register_forward_hook(hook_fns_forward)
|
|
107
|
+
# with torch.no_grad():
|
|
108
|
+
# _ = m(all_imgs.cuda())
|
|
109
|
+
# handle.remove()
|
|
110
|
+
# acts = self.get_actmap(act_outputs[0], sz)
|
|
111
|
+
# for i in range(top + 1):
|
|
112
|
+
# axes.flat[i].imshow(acts[i], alpha=0.3, cmap='jet')
|
|
113
|
+
if vis_label:
|
|
114
|
+
label_indice = np.where(cmc == 1)[0]
|
|
115
|
+
if label_sort == "ascending": label_indice = label_indice[::-1]
|
|
116
|
+
label_indice = label_indice[:max_rank]
|
|
117
|
+
for i in range(max_rank):
|
|
118
|
+
if i >= len(label_indice): break
|
|
119
|
+
j = label_indice[i]
|
|
120
|
+
g_idx = self.num_query + sort_idx[j]
|
|
121
|
+
gallery_info = self.dataset[g_idx]
|
|
122
|
+
gallery_img = gallery_info['images']
|
|
123
|
+
cam_id = gallery_info['camids']
|
|
124
|
+
gallery_img = np.rollaxis(np.asarray(gallery_img, dtype=np.uint8), 0, 3)
|
|
125
|
+
ax = fig.add_subplot(2, max_rank + 1, max_rank + 3 + i)
|
|
126
|
+
ax.add_patch(plt.Rectangle(xy=(0, 0), width=gallery_img.shape[1] - 1,
|
|
127
|
+
height=gallery_img.shape[0] - 1,
|
|
128
|
+
edgecolor=(1, 0, 0),
|
|
129
|
+
fill=False, linewidth=5))
|
|
130
|
+
ax.imshow(gallery_img)
|
|
131
|
+
ax.set_title(f'{self.sim[q_idx, sort_idx[j]]:.3f}/cam{cam_id}')
|
|
132
|
+
ax.axis("off")
|
|
133
|
+
|
|
134
|
+
plt.tight_layout()
|
|
135
|
+
filepath = os.path.join(output, "{}.jpg".format(cnt))
|
|
136
|
+
fig.savefig(filepath)
|
|
137
|
+
|
|
138
|
+
def vis_rank_list(self, output, vis_label, num_vis=100, rank_sort="ascending", label_sort="ascending", max_rank=5,
|
|
139
|
+
actmap=False):
|
|
140
|
+
r"""Visualize rank list of query instance
|
|
141
|
+
Args:
|
|
142
|
+
output (str): a directory to save rank list result.
|
|
143
|
+
vis_label (bool): if visualize label of query
|
|
144
|
+
num_vis (int):
|
|
145
|
+
rank_sort (str): save visualization results by which order,
|
|
146
|
+
if rank_sort is ascending, AP from low to high, vice versa.
|
|
147
|
+
label_sort (bool):
|
|
148
|
+
max_rank (int): maximum number of rank result to visualize
|
|
149
|
+
actmap (bool):
|
|
150
|
+
"""
|
|
151
|
+
assert rank_sort in ['ascending', 'descending'], "{} not match [ascending, descending]".format(rank_sort)
|
|
152
|
+
|
|
153
|
+
query_indices = np.argsort(self.all_ap)
|
|
154
|
+
if rank_sort == 'descending': query_indices = query_indices[::-1]
|
|
155
|
+
|
|
156
|
+
query_indices = query_indices[:int(num_vis)]
|
|
157
|
+
self.save_rank_result(query_indices, output, max_rank, vis_label, label_sort, actmap)
|
|
158
|
+
|
|
159
|
+
def vis_roc_curve(self, output):
|
|
160
|
+
PathManager.mkdirs(output)
|
|
161
|
+
pos, neg = [], []
|
|
162
|
+
for i, q in enumerate(self.q_pids):
|
|
163
|
+
cmc, sort_idx = self.get_matched_result(i) # remove same id in same camera
|
|
164
|
+
ind_pos = np.where(cmc == 1)[0]
|
|
165
|
+
q_dist = self.dist[i]
|
|
166
|
+
pos.extend(q_dist[sort_idx[ind_pos]])
|
|
167
|
+
|
|
168
|
+
ind_neg = np.where(cmc == 0)[0]
|
|
169
|
+
neg.extend(q_dist[sort_idx[ind_neg]])
|
|
170
|
+
|
|
171
|
+
scores = np.hstack((pos, neg))
|
|
172
|
+
labels = np.hstack((np.zeros(len(pos)), np.ones(len(neg))))
|
|
173
|
+
|
|
174
|
+
fpr, tpr, thresholds = metrics.roc_curve(labels, scores)
|
|
175
|
+
|
|
176
|
+
self.plot_roc_curve(fpr, tpr)
|
|
177
|
+
filepath = os.path.join(output, "roc.jpg")
|
|
178
|
+
plt.savefig(filepath)
|
|
179
|
+
# self.plot_distribution(pos, neg)
|
|
180
|
+
# filepath = os.path.join(output, "pos_neg_dist.jpg")
|
|
181
|
+
# plt.savefig(filepath)
|
|
182
|
+
return fpr, tpr, pos, neg
|
|
183
|
+
|
|
184
|
+
@staticmethod
|
|
185
|
+
def plot_roc_curve(fpr, tpr, name='model', fig=None):
|
|
186
|
+
if fig is None:
|
|
187
|
+
fig = plt.figure()
|
|
188
|
+
plt.semilogx(np.arange(0, 1, 0.01), np.arange(0, 1, 0.01), 'r', linestyle='--', label='Random guess')
|
|
189
|
+
plt.semilogx(fpr, tpr, color=(random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1)),
|
|
190
|
+
label='ROC curve with {}'.format(name))
|
|
191
|
+
plt.title('Receiver Operating Characteristic')
|
|
192
|
+
plt.xlabel('False Positive Rate')
|
|
193
|
+
plt.ylabel('True Positive Rate')
|
|
194
|
+
plt.legend(loc='best')
|
|
195
|
+
return fig
|
|
196
|
+
|
|
197
|
+
@staticmethod
|
|
198
|
+
def plot_distribution(pos, neg, name='model', fig=None):
|
|
199
|
+
if fig is None:
|
|
200
|
+
fig = plt.figure()
|
|
201
|
+
pos_color = (random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1))
|
|
202
|
+
n, bins, _ = plt.hist(pos, bins=80, alpha=0.7, density=True,
|
|
203
|
+
color=pos_color,
|
|
204
|
+
label='positive with {}'.format(name))
|
|
205
|
+
mu = np.mean(pos)
|
|
206
|
+
sigma = np.std(pos)
|
|
207
|
+
y = norm.pdf(bins, mu, sigma) # fitting curve
|
|
208
|
+
plt.plot(bins, y, color=pos_color) # plot y curve
|
|
209
|
+
|
|
210
|
+
neg_color = (random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1))
|
|
211
|
+
n, bins, _ = plt.hist(neg, bins=80, alpha=0.5, density=True,
|
|
212
|
+
color=neg_color,
|
|
213
|
+
label='negative with {}'.format(name))
|
|
214
|
+
mu = np.mean(neg)
|
|
215
|
+
sigma = np.std(neg)
|
|
216
|
+
y = norm.pdf(bins, mu, sigma) # fitting curve
|
|
217
|
+
plt.plot(bins, y, color=neg_color) # plot y curve
|
|
218
|
+
|
|
219
|
+
plt.xticks(np.arange(0, 1.5, 0.1))
|
|
220
|
+
plt.title('positive and negative pairs distribution')
|
|
221
|
+
plt.legend(loc='best')
|
|
222
|
+
return fig
|
|
223
|
+
|
|
224
|
+
@staticmethod
|
|
225
|
+
def save_roc_info(output, fpr, tpr, pos, neg):
|
|
226
|
+
results = {
|
|
227
|
+
"fpr": np.asarray(fpr),
|
|
228
|
+
"tpr": np.asarray(tpr),
|
|
229
|
+
"pos": np.asarray(pos),
|
|
230
|
+
"neg": np.asarray(neg),
|
|
231
|
+
}
|
|
232
|
+
with open(os.path.join(output, "roc_info.pickle"), "wb") as handle:
|
|
233
|
+
pickle.dump(results, handle, protocol=pickle.HIGHEST_PROTOCOL)
|
|
234
|
+
|
|
235
|
+
@staticmethod
|
|
236
|
+
def load_roc_info(path):
|
|
237
|
+
with open(path, 'rb') as handle: res = pickle.load(handle)
|
|
238
|
+
return res
|
|
239
|
+
|
|
240
|
+
# def plot_camera_dist(self):
|
|
241
|
+
# same_cam, diff_cam = [], []
|
|
242
|
+
# for i, q in enumerate(self.q_pids):
|
|
243
|
+
# q_camid = self.q_camids[i]
|
|
244
|
+
#
|
|
245
|
+
# order = self.indices[i]
|
|
246
|
+
# same = (self.g_pids[order] == q) & (self.g_camids[order] == q_camid)
|
|
247
|
+
# diff = (self.g_pids[order] == q) & (self.g_camids[order] != q_camid)
|
|
248
|
+
# sameCam_idx = order[same]
|
|
249
|
+
# diffCam_idx = order[diff]
|
|
250
|
+
#
|
|
251
|
+
# same_cam.extend(self.sim[i, sameCam_idx])
|
|
252
|
+
# diff_cam.extend(self.sim[i, diffCam_idx])
|
|
253
|
+
#
|
|
254
|
+
# fig = plt.figure(figsize=(10, 5))
|
|
255
|
+
# plt.hist(same_cam, bins=80, alpha=0.7, density=True, color='red', label='same camera')
|
|
256
|
+
# plt.hist(diff_cam, bins=80, alpha=0.5, density=True, color='blue', label='diff camera')
|
|
257
|
+
# plt.xticks(np.arange(0.1, 1.0, 0.1))
|
|
258
|
+
# plt.title('positive and negative pair distribution')
|
|
259
|
+
# return fig
|
|
260
|
+
|
|
261
|
+
# def get_actmap(self, features, sz):
|
|
262
|
+
# """
|
|
263
|
+
# :param features: (1, 2048, 16, 8) activation map
|
|
264
|
+
# :return:
|
|
265
|
+
# """
|
|
266
|
+
# features = (features ** 2).sum(1) # (1, 16, 8)
|
|
267
|
+
# b, h, w = features.size()
|
|
268
|
+
# features = features.view(b, h * w)
|
|
269
|
+
# features = nn.functional.normalize(features, p=2, dim=1)
|
|
270
|
+
# acts = features.view(b, h, w)
|
|
271
|
+
# all_acts = []
|
|
272
|
+
# for i in range(b):
|
|
273
|
+
# act = acts[i].numpy()
|
|
274
|
+
# act = cv2.resize(act, (sz[1], sz[0]))
|
|
275
|
+
# act = 255 * (act - act.max()) / (act.max() - act.min() + 1e-12)
|
|
276
|
+
# act = np.uint8(np.floor(act))
|
|
277
|
+
# all_acts.append(act)
|
|
278
|
+
# return all_acts
|
dnt/track/__init__.py
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from collections import OrderedDict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class TrackState(object):
|
|
6
|
+
New = 0
|
|
7
|
+
Tracked = 1
|
|
8
|
+
Lost = 2
|
|
9
|
+
LongLost = 3
|
|
10
|
+
Removed = 4
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BaseTrack(object):
|
|
14
|
+
_count = 0
|
|
15
|
+
|
|
16
|
+
track_id = 0
|
|
17
|
+
is_activated = False
|
|
18
|
+
state = TrackState.New
|
|
19
|
+
|
|
20
|
+
history = OrderedDict()
|
|
21
|
+
features = []
|
|
22
|
+
curr_feature = None
|
|
23
|
+
score = 0
|
|
24
|
+
start_frame = 0
|
|
25
|
+
frame_id = 0
|
|
26
|
+
time_since_update = 0
|
|
27
|
+
|
|
28
|
+
# multi-camera
|
|
29
|
+
location = (np.inf, np.inf)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def end_frame(self):
|
|
33
|
+
return self.frame_id
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def next_id():
|
|
37
|
+
BaseTrack._count += 1
|
|
38
|
+
return BaseTrack._count
|
|
39
|
+
|
|
40
|
+
def activate(self, *args):
|
|
41
|
+
raise NotImplementedError
|
|
42
|
+
|
|
43
|
+
def predict(self):
|
|
44
|
+
raise NotImplementedError
|
|
45
|
+
|
|
46
|
+
def update(self, *args, **kwargs):
|
|
47
|
+
raise NotImplementedError
|
|
48
|
+
|
|
49
|
+
def mark_lost(self):
|
|
50
|
+
self.state = TrackState.Lost
|
|
51
|
+
|
|
52
|
+
def mark_long_lost(self):
|
|
53
|
+
self.state = TrackState.LongLost
|
|
54
|
+
|
|
55
|
+
def mark_removed(self):
|
|
56
|
+
self.state = TrackState.Removed
|
|
57
|
+
|
|
58
|
+
@staticmethod
|
|
59
|
+
def clear_count():
|
|
60
|
+
BaseTrack._count = 0
|