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,283 @@
|
|
|
1
|
+
from functools import partial
|
|
2
|
+
from typing import Any, Callable, Dict, List, Optional, Sequence
|
|
3
|
+
|
|
4
|
+
import torch
|
|
5
|
+
from torch import nn, Tensor
|
|
6
|
+
from torch.nn import functional as F
|
|
7
|
+
|
|
8
|
+
#The style of importing Considers compatibility for the diversity of torchvision versions
|
|
9
|
+
try:
|
|
10
|
+
from torchvision.models.utils import load_state_dict_from_url
|
|
11
|
+
except ImportError:
|
|
12
|
+
try:
|
|
13
|
+
from torch.hub import load_state_dict_from_url
|
|
14
|
+
except ImportError:
|
|
15
|
+
from torch.utils.model_zoo import load_url as load_state_dict_from_url
|
|
16
|
+
|
|
17
|
+
from fastreid.layers import get_norm
|
|
18
|
+
from .build import BACKBONE_REGISTRY
|
|
19
|
+
from .mobilenet import _make_divisible
|
|
20
|
+
|
|
21
|
+
# https://github.com/pytorch/vision/blob/master/torchvision/models/mobilenetv3.py
|
|
22
|
+
|
|
23
|
+
model_urls = {
|
|
24
|
+
"Large": "https://download.pytorch.org/models/mobilenet_v3_large-8738ca79.pth",
|
|
25
|
+
"Small": "https://download.pytorch.org/models/mobilenet_v3_small-047dcff4.pth",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def conv_1x1_bn(inp, oup, bn_norm):
|
|
30
|
+
return nn.Sequential(
|
|
31
|
+
nn.Conv2d(inp, oup, 1, 1, 0, bias=False),
|
|
32
|
+
get_norm(bn_norm, oup),
|
|
33
|
+
nn.ReLU6(inplace=True)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ConvBNActivation(nn.Sequential):
|
|
38
|
+
def __init__(
|
|
39
|
+
self,
|
|
40
|
+
in_planes: int,
|
|
41
|
+
out_planes: int,
|
|
42
|
+
kernel_size: int = 3,
|
|
43
|
+
stride: int = 1,
|
|
44
|
+
groups: int = 1,
|
|
45
|
+
bn_norm=None,
|
|
46
|
+
activation_layer: Optional[Callable[..., nn.Module]] = None,
|
|
47
|
+
dilation: int = 1,
|
|
48
|
+
) -> None:
|
|
49
|
+
padding = (kernel_size - 1) // 2 * dilation
|
|
50
|
+
if activation_layer is None:
|
|
51
|
+
activation_layer = nn.ReLU6
|
|
52
|
+
super(ConvBNActivation, self).__init__(
|
|
53
|
+
nn.Conv2d(in_planes, out_planes, kernel_size, stride, padding, dilation=dilation, groups=groups,
|
|
54
|
+
bias=False),
|
|
55
|
+
get_norm(bn_norm, out_planes),
|
|
56
|
+
activation_layer(inplace=True)
|
|
57
|
+
)
|
|
58
|
+
self.out_channels = out_planes
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class SqueezeExcitation(nn.Module):
|
|
62
|
+
def __init__(self, input_channels: int, squeeze_factor: int = 4):
|
|
63
|
+
super().__init__()
|
|
64
|
+
squeeze_channels = _make_divisible(input_channels // squeeze_factor, 8)
|
|
65
|
+
self.fc1 = nn.Conv2d(input_channels, squeeze_channels, 1)
|
|
66
|
+
self.relu = nn.ReLU(inplace=True)
|
|
67
|
+
self.fc2 = nn.Conv2d(squeeze_channels, input_channels, 1)
|
|
68
|
+
|
|
69
|
+
def _scale(self, input: Tensor, inplace: bool) -> Tensor:
|
|
70
|
+
scale = F.adaptive_avg_pool2d(input, 1)
|
|
71
|
+
scale = self.fc1(scale)
|
|
72
|
+
scale = self.relu(scale)
|
|
73
|
+
scale = self.fc2(scale)
|
|
74
|
+
return F.hardsigmoid(scale, inplace=inplace)
|
|
75
|
+
|
|
76
|
+
def forward(self, input: Tensor) -> Tensor:
|
|
77
|
+
scale = self._scale(input, True)
|
|
78
|
+
return scale * input
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class InvertedResidualConfig:
|
|
82
|
+
def __init__(self, input_channels: int, kernel: int, expanded_channels: int, out_channels: int, use_se: bool,
|
|
83
|
+
activation: str, stride: int, dilation: int, width_mult: float):
|
|
84
|
+
self.input_channels = self.adjust_channels(input_channels, width_mult)
|
|
85
|
+
self.kernel = kernel
|
|
86
|
+
self.expanded_channels = self.adjust_channels(expanded_channels, width_mult)
|
|
87
|
+
self.out_channels = self.adjust_channels(out_channels, width_mult)
|
|
88
|
+
self.use_se = use_se
|
|
89
|
+
self.use_hs = activation == "HS"
|
|
90
|
+
self.stride = stride
|
|
91
|
+
self.dilation = dilation
|
|
92
|
+
|
|
93
|
+
@staticmethod
|
|
94
|
+
def adjust_channels(channels: int, width_mult: float):
|
|
95
|
+
return _make_divisible(channels * width_mult, 8)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class InvertedResidual(nn.Module):
|
|
99
|
+
def __init__(self, cnf: InvertedResidualConfig, bn_norm,
|
|
100
|
+
se_layer: Callable[..., nn.Module] = SqueezeExcitation):
|
|
101
|
+
super().__init__()
|
|
102
|
+
if not (1 <= cnf.stride <= 2):
|
|
103
|
+
raise ValueError('illegal stride value')
|
|
104
|
+
|
|
105
|
+
self.use_res_connect = cnf.stride == 1 and cnf.input_channels == cnf.out_channels
|
|
106
|
+
|
|
107
|
+
layers: List[nn.Module] = []
|
|
108
|
+
activation_layer = nn.Hardswish if cnf.use_hs else nn.ReLU
|
|
109
|
+
|
|
110
|
+
# expand
|
|
111
|
+
if cnf.expanded_channels != cnf.input_channels:
|
|
112
|
+
layers.append(ConvBNActivation(cnf.input_channels, cnf.expanded_channels, kernel_size=1,
|
|
113
|
+
bn_norm=bn_norm, activation_layer=activation_layer))
|
|
114
|
+
|
|
115
|
+
# depthwise
|
|
116
|
+
stride = 1 if cnf.dilation > 1 else cnf.stride
|
|
117
|
+
layers.append(ConvBNActivation(cnf.expanded_channels, cnf.expanded_channels, kernel_size=cnf.kernel,
|
|
118
|
+
stride=stride, dilation=cnf.dilation, groups=cnf.expanded_channels,
|
|
119
|
+
bn_norm=bn_norm, activation_layer=activation_layer))
|
|
120
|
+
if cnf.use_se:
|
|
121
|
+
layers.append(se_layer(cnf.expanded_channels))
|
|
122
|
+
|
|
123
|
+
# project
|
|
124
|
+
layers.append(ConvBNActivation(cnf.expanded_channels, cnf.out_channels, kernel_size=1, bn_norm=bn_norm,
|
|
125
|
+
activation_layer=nn.Identity))
|
|
126
|
+
|
|
127
|
+
self.block = nn.Sequential(*layers)
|
|
128
|
+
self.out_channels = cnf.out_channels
|
|
129
|
+
self._is_cn = cnf.stride > 1
|
|
130
|
+
|
|
131
|
+
def forward(self, input: Tensor) -> Tensor:
|
|
132
|
+
result = self.block(input)
|
|
133
|
+
if self.use_res_connect:
|
|
134
|
+
result += input
|
|
135
|
+
return result
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class MobileNetV3(nn.Module):
|
|
139
|
+
def __init__(
|
|
140
|
+
self,
|
|
141
|
+
bn_norm,
|
|
142
|
+
inverted_residual_setting: List[InvertedResidualConfig],
|
|
143
|
+
last_channel: int,
|
|
144
|
+
block: Optional[Callable[..., nn.Module]] = None,
|
|
145
|
+
) -> None:
|
|
146
|
+
"""
|
|
147
|
+
MobileNet V3 main class
|
|
148
|
+
Args:
|
|
149
|
+
inverted_residual_setting (List[InvertedResidualConfig]): Network structure
|
|
150
|
+
last_channel (int): The number of channels on the penultimate layer
|
|
151
|
+
block (Optional[Callable[..., nn.Module]]): Module specifying inverted residual building block for mobilenet
|
|
152
|
+
"""
|
|
153
|
+
super().__init__()
|
|
154
|
+
|
|
155
|
+
if not inverted_residual_setting:
|
|
156
|
+
raise ValueError("The inverted_residual_setting should not be empty")
|
|
157
|
+
elif not (isinstance(inverted_residual_setting, Sequence) and
|
|
158
|
+
all([isinstance(s, InvertedResidualConfig) for s in inverted_residual_setting])):
|
|
159
|
+
raise TypeError("The inverted_residual_setting should be List[InvertedResidualConfig]")
|
|
160
|
+
|
|
161
|
+
if block is None:
|
|
162
|
+
block = InvertedResidual
|
|
163
|
+
|
|
164
|
+
layers: List[nn.Module] = []
|
|
165
|
+
|
|
166
|
+
# building first layer
|
|
167
|
+
firstconv_output_channels = inverted_residual_setting[0].input_channels
|
|
168
|
+
layers.append(ConvBNActivation(3, firstconv_output_channels, kernel_size=3, stride=2, bn_norm=bn_norm,
|
|
169
|
+
activation_layer=nn.Hardswish))
|
|
170
|
+
|
|
171
|
+
# building inverted residual blocks
|
|
172
|
+
for cnf in inverted_residual_setting:
|
|
173
|
+
layers.append(block(cnf, bn_norm))
|
|
174
|
+
|
|
175
|
+
# building last several layers
|
|
176
|
+
lastconv_input_channels = inverted_residual_setting[-1].out_channels
|
|
177
|
+
lastconv_output_channels = 6 * lastconv_input_channels
|
|
178
|
+
layers.append(ConvBNActivation(lastconv_input_channels, lastconv_output_channels, kernel_size=1,
|
|
179
|
+
bn_norm=bn_norm, activation_layer=nn.Hardswish))
|
|
180
|
+
|
|
181
|
+
self.features = nn.Sequential(*layers)
|
|
182
|
+
self.conv = conv_1x1_bn(lastconv_output_channels, last_channel, bn_norm)
|
|
183
|
+
|
|
184
|
+
for m in self.modules():
|
|
185
|
+
if isinstance(m, nn.Conv2d):
|
|
186
|
+
nn.init.kaiming_normal_(m.weight, mode='fan_out')
|
|
187
|
+
if m.bias is not None:
|
|
188
|
+
nn.init.zeros_(m.bias)
|
|
189
|
+
elif isinstance(m, (nn.BatchNorm2d, nn.GroupNorm)):
|
|
190
|
+
nn.init.ones_(m.weight)
|
|
191
|
+
nn.init.zeros_(m.bias)
|
|
192
|
+
elif isinstance(m, nn.Linear):
|
|
193
|
+
nn.init.normal_(m.weight, 0, 0.01)
|
|
194
|
+
nn.init.zeros_(m.bias)
|
|
195
|
+
|
|
196
|
+
def _forward_impl(self, x: Tensor) -> Tensor:
|
|
197
|
+
x = self.features(x)
|
|
198
|
+
x = self.conv(x)
|
|
199
|
+
return x
|
|
200
|
+
|
|
201
|
+
def forward(self, x: Tensor) -> Tensor:
|
|
202
|
+
return self._forward_impl(x)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def _mobilenet_v3_conf(arch: str, params: Dict[str, Any]):
|
|
206
|
+
# non-public config parameters
|
|
207
|
+
reduce_divider = 2 if params.pop('_reduced_tail', False) else 1
|
|
208
|
+
dilation = 2 if params.pop('_dilated', False) else 1
|
|
209
|
+
width_mult = params.pop('_width_mult', 1.0)
|
|
210
|
+
|
|
211
|
+
bneck_conf = partial(InvertedResidualConfig, width_mult=width_mult)
|
|
212
|
+
adjust_channels = partial(InvertedResidualConfig.adjust_channels, width_mult=width_mult)
|
|
213
|
+
|
|
214
|
+
if arch == "Large":
|
|
215
|
+
inverted_residual_setting = [
|
|
216
|
+
bneck_conf(16, 3, 16, 16, False, "RE", 1, 1),
|
|
217
|
+
bneck_conf(16, 3, 64, 24, False, "RE", 2, 1), # C1
|
|
218
|
+
bneck_conf(24, 3, 72, 24, False, "RE", 1, 1),
|
|
219
|
+
bneck_conf(24, 5, 72, 40, True, "RE", 2, 1), # C2
|
|
220
|
+
bneck_conf(40, 5, 120, 40, True, "RE", 1, 1),
|
|
221
|
+
bneck_conf(40, 5, 120, 40, True, "RE", 1, 1),
|
|
222
|
+
bneck_conf(40, 3, 240, 80, False, "HS", 2, 1), # C3
|
|
223
|
+
bneck_conf(80, 3, 200, 80, False, "HS", 1, 1),
|
|
224
|
+
bneck_conf(80, 3, 184, 80, False, "HS", 1, 1),
|
|
225
|
+
bneck_conf(80, 3, 184, 80, False, "HS", 1, 1),
|
|
226
|
+
bneck_conf(80, 3, 480, 112, True, "HS", 1, 1),
|
|
227
|
+
bneck_conf(112, 3, 672, 112, True, "HS", 1, 1),
|
|
228
|
+
bneck_conf(112, 5, 672, 160 // reduce_divider, True, "HS", 2, dilation), # C4
|
|
229
|
+
bneck_conf(160 // reduce_divider, 5, 960 // reduce_divider, 160 // reduce_divider, True, "HS", 1, dilation),
|
|
230
|
+
bneck_conf(160 // reduce_divider, 5, 960 // reduce_divider, 160 // reduce_divider, True, "HS", 1, dilation),
|
|
231
|
+
]
|
|
232
|
+
last_channel = adjust_channels(1280 // reduce_divider) # C5
|
|
233
|
+
elif arch == "Small":
|
|
234
|
+
inverted_residual_setting = [
|
|
235
|
+
bneck_conf(16, 3, 16, 16, True, "RE", 2, 1), # C1
|
|
236
|
+
bneck_conf(16, 3, 72, 24, False, "RE", 2, 1), # C2
|
|
237
|
+
bneck_conf(24, 3, 88, 24, False, "RE", 1, 1),
|
|
238
|
+
bneck_conf(24, 5, 96, 40, True, "HS", 2, 1), # C3
|
|
239
|
+
bneck_conf(40, 5, 240, 40, True, "HS", 1, 1),
|
|
240
|
+
bneck_conf(40, 5, 240, 40, True, "HS", 1, 1),
|
|
241
|
+
bneck_conf(40, 5, 120, 48, True, "HS", 1, 1),
|
|
242
|
+
bneck_conf(48, 5, 144, 48, True, "HS", 1, 1),
|
|
243
|
+
bneck_conf(48, 5, 288, 96 // reduce_divider, True, "HS", 2, dilation), # C4
|
|
244
|
+
bneck_conf(96 // reduce_divider, 5, 576 // reduce_divider, 96 // reduce_divider, True, "HS", 1, dilation),
|
|
245
|
+
bneck_conf(96 // reduce_divider, 5, 576 // reduce_divider, 96 // reduce_divider, True, "HS", 1, dilation),
|
|
246
|
+
]
|
|
247
|
+
last_channel = adjust_channels(1024 // reduce_divider) # C5
|
|
248
|
+
else:
|
|
249
|
+
raise ValueError("Unsupported model type {}".format(arch))
|
|
250
|
+
|
|
251
|
+
return inverted_residual_setting, last_channel
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def _mobilenet_v3_model(
|
|
255
|
+
bn_norm,
|
|
256
|
+
depth: str,
|
|
257
|
+
pretrained: bool,
|
|
258
|
+
pretrain_path: str,
|
|
259
|
+
**kwargs: Any
|
|
260
|
+
):
|
|
261
|
+
inverted_residual_setting, last_channel = _mobilenet_v3_conf(depth, kwargs)
|
|
262
|
+
model = MobileNetV3(bn_norm, inverted_residual_setting, last_channel, **kwargs)
|
|
263
|
+
if pretrained:
|
|
264
|
+
if pretrain_path:
|
|
265
|
+
state_dict = torch.load(pretrain_path)
|
|
266
|
+
else:
|
|
267
|
+
if model_urls.get(depth, None) is None:
|
|
268
|
+
raise ValueError("No checkpoint is available for model type {}".format(depth))
|
|
269
|
+
state_dict = load_state_dict_from_url(model_urls[depth], progress=True)
|
|
270
|
+
model.load_state_dict(state_dict, strict=False)
|
|
271
|
+
return model
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
@BACKBONE_REGISTRY.register()
|
|
275
|
+
def build_mobilenetv3_backbone(cfg):
|
|
276
|
+
pretrain = cfg.MODEL.BACKBONE.PRETRAIN
|
|
277
|
+
pretrain_path = cfg.MODEL.BACKBONE.PRETRAIN_PATH
|
|
278
|
+
bn_norm = cfg.MODEL.BACKBONE.NORM
|
|
279
|
+
depth = cfg.MODEL.BACKBONE.DEPTH
|
|
280
|
+
|
|
281
|
+
model = _mobilenet_v3_model(bn_norm, depth, pretrain, pretrain_path)
|
|
282
|
+
|
|
283
|
+
return model
|