dnt 0.2.4__py3-none-any.whl → 0.3.1.7__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/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 +605 -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.2.4.dist-info → dnt-0.3.1.7.dist-info}/METADATA +41 -13
- dnt-0.3.1.7.dist-info/RECORD +315 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.7.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.7.dist-info/licenses}/LICENSE +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.7.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: liaoxingyu
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import torch
|
|
8
|
+
from torch import nn
|
|
9
|
+
|
|
10
|
+
from fastreid.config import configurable
|
|
11
|
+
from fastreid.modeling.backbones import build_backbone
|
|
12
|
+
from fastreid.modeling.heads import build_heads
|
|
13
|
+
from fastreid.modeling.losses import *
|
|
14
|
+
from .build import META_ARCH_REGISTRY
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@META_ARCH_REGISTRY.register()
|
|
18
|
+
class Baseline(nn.Module):
|
|
19
|
+
"""
|
|
20
|
+
Baseline architecture. Any models that contains the following two components:
|
|
21
|
+
1. Per-image feature extraction (aka backbone)
|
|
22
|
+
2. Per-image feature aggregation and loss computation
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
@configurable
|
|
26
|
+
def __init__(
|
|
27
|
+
self,
|
|
28
|
+
*,
|
|
29
|
+
backbone,
|
|
30
|
+
heads,
|
|
31
|
+
pixel_mean,
|
|
32
|
+
pixel_std,
|
|
33
|
+
loss_kwargs=None
|
|
34
|
+
):
|
|
35
|
+
"""
|
|
36
|
+
NOTE: this interface is experimental.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
backbone:
|
|
40
|
+
heads:
|
|
41
|
+
pixel_mean:
|
|
42
|
+
pixel_std:
|
|
43
|
+
"""
|
|
44
|
+
super().__init__()
|
|
45
|
+
# backbone
|
|
46
|
+
self.backbone = backbone
|
|
47
|
+
|
|
48
|
+
# head
|
|
49
|
+
self.heads = heads
|
|
50
|
+
|
|
51
|
+
self.loss_kwargs = loss_kwargs
|
|
52
|
+
|
|
53
|
+
self.register_buffer('pixel_mean', torch.Tensor(pixel_mean).view(1, -1, 1, 1), False)
|
|
54
|
+
self.register_buffer('pixel_std', torch.Tensor(pixel_std).view(1, -1, 1, 1), False)
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_config(cls, cfg):
|
|
58
|
+
backbone = build_backbone(cfg)
|
|
59
|
+
heads = build_heads(cfg)
|
|
60
|
+
return {
|
|
61
|
+
'backbone': backbone,
|
|
62
|
+
'heads': heads,
|
|
63
|
+
'pixel_mean': cfg.MODEL.PIXEL_MEAN,
|
|
64
|
+
'pixel_std': cfg.MODEL.PIXEL_STD,
|
|
65
|
+
'loss_kwargs':
|
|
66
|
+
{
|
|
67
|
+
# loss name
|
|
68
|
+
'loss_names': cfg.MODEL.LOSSES.NAME,
|
|
69
|
+
|
|
70
|
+
# loss hyperparameters
|
|
71
|
+
'ce': {
|
|
72
|
+
'eps': cfg.MODEL.LOSSES.CE.EPSILON,
|
|
73
|
+
'alpha': cfg.MODEL.LOSSES.CE.ALPHA,
|
|
74
|
+
'scale': cfg.MODEL.LOSSES.CE.SCALE
|
|
75
|
+
},
|
|
76
|
+
'tri': {
|
|
77
|
+
'margin': cfg.MODEL.LOSSES.TRI.MARGIN,
|
|
78
|
+
'norm_feat': cfg.MODEL.LOSSES.TRI.NORM_FEAT,
|
|
79
|
+
'hard_mining': cfg.MODEL.LOSSES.TRI.HARD_MINING,
|
|
80
|
+
'scale': cfg.MODEL.LOSSES.TRI.SCALE
|
|
81
|
+
},
|
|
82
|
+
'circle': {
|
|
83
|
+
'margin': cfg.MODEL.LOSSES.CIRCLE.MARGIN,
|
|
84
|
+
'gamma': cfg.MODEL.LOSSES.CIRCLE.GAMMA,
|
|
85
|
+
'scale': cfg.MODEL.LOSSES.CIRCLE.SCALE
|
|
86
|
+
},
|
|
87
|
+
'cosface': {
|
|
88
|
+
'margin': cfg.MODEL.LOSSES.COSFACE.MARGIN,
|
|
89
|
+
'gamma': cfg.MODEL.LOSSES.COSFACE.GAMMA,
|
|
90
|
+
'scale': cfg.MODEL.LOSSES.COSFACE.SCALE
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def device(self):
|
|
97
|
+
return self.pixel_mean.device
|
|
98
|
+
|
|
99
|
+
def forward(self, batched_inputs):
|
|
100
|
+
images = self.preprocess_image(batched_inputs)
|
|
101
|
+
features = self.backbone(images)
|
|
102
|
+
|
|
103
|
+
if self.training:
|
|
104
|
+
assert "targets" in batched_inputs, "Person ID annotation are missing in training!"
|
|
105
|
+
targets = batched_inputs["targets"]
|
|
106
|
+
|
|
107
|
+
# PreciseBN flag, When do preciseBN on different dataset, the number of classes in new dataset
|
|
108
|
+
# may be larger than that in the original dataset, so the circle/arcface will
|
|
109
|
+
# throw an error. We just set all the targets to 0 to avoid this problem.
|
|
110
|
+
if targets.sum() < 0: targets.zero_()
|
|
111
|
+
|
|
112
|
+
outputs = self.heads(features, targets)
|
|
113
|
+
losses = self.losses(outputs, targets)
|
|
114
|
+
return losses
|
|
115
|
+
else:
|
|
116
|
+
outputs = self.heads(features)
|
|
117
|
+
return outputs
|
|
118
|
+
|
|
119
|
+
def preprocess_image(self, batched_inputs):
|
|
120
|
+
"""
|
|
121
|
+
Normalize and batch the input images.
|
|
122
|
+
"""
|
|
123
|
+
if isinstance(batched_inputs, dict):
|
|
124
|
+
images = batched_inputs['images']
|
|
125
|
+
elif isinstance(batched_inputs, torch.Tensor):
|
|
126
|
+
images = batched_inputs
|
|
127
|
+
else:
|
|
128
|
+
raise TypeError("batched_inputs must be dict or torch.Tensor, but get {}".format(type(batched_inputs)))
|
|
129
|
+
|
|
130
|
+
images.sub_(self.pixel_mean).div_(self.pixel_std)
|
|
131
|
+
return images
|
|
132
|
+
|
|
133
|
+
def losses(self, outputs, gt_labels):
|
|
134
|
+
"""
|
|
135
|
+
Compute loss from modeling's outputs, the loss function input arguments
|
|
136
|
+
must be the same as the outputs of the model forwarding.
|
|
137
|
+
"""
|
|
138
|
+
# model predictions
|
|
139
|
+
# fmt: off
|
|
140
|
+
pred_class_logits = outputs['pred_class_logits'].detach()
|
|
141
|
+
cls_outputs = outputs['cls_outputs']
|
|
142
|
+
pred_features = outputs['features']
|
|
143
|
+
# fmt: on
|
|
144
|
+
|
|
145
|
+
# Log prediction accuracy
|
|
146
|
+
log_accuracy(pred_class_logits, gt_labels)
|
|
147
|
+
|
|
148
|
+
loss_dict = {}
|
|
149
|
+
loss_names = self.loss_kwargs['loss_names']
|
|
150
|
+
|
|
151
|
+
if 'CrossEntropyLoss' in loss_names:
|
|
152
|
+
ce_kwargs = self.loss_kwargs.get('ce')
|
|
153
|
+
loss_dict['loss_cls'] = cross_entropy_loss(
|
|
154
|
+
cls_outputs,
|
|
155
|
+
gt_labels,
|
|
156
|
+
ce_kwargs.get('eps'),
|
|
157
|
+
ce_kwargs.get('alpha')
|
|
158
|
+
) * ce_kwargs.get('scale')
|
|
159
|
+
|
|
160
|
+
if 'TripletLoss' in loss_names:
|
|
161
|
+
tri_kwargs = self.loss_kwargs.get('tri')
|
|
162
|
+
loss_dict['loss_triplet'] = triplet_loss(
|
|
163
|
+
pred_features,
|
|
164
|
+
gt_labels,
|
|
165
|
+
tri_kwargs.get('margin'),
|
|
166
|
+
tri_kwargs.get('norm_feat'),
|
|
167
|
+
tri_kwargs.get('hard_mining')
|
|
168
|
+
) * tri_kwargs.get('scale')
|
|
169
|
+
|
|
170
|
+
if 'CircleLoss' in loss_names:
|
|
171
|
+
circle_kwargs = self.loss_kwargs.get('circle')
|
|
172
|
+
loss_dict['loss_circle'] = pairwise_circleloss(
|
|
173
|
+
pred_features,
|
|
174
|
+
gt_labels,
|
|
175
|
+
circle_kwargs.get('margin'),
|
|
176
|
+
circle_kwargs.get('gamma')
|
|
177
|
+
) * circle_kwargs.get('scale')
|
|
178
|
+
|
|
179
|
+
if 'Cosface' in loss_names:
|
|
180
|
+
cosface_kwargs = self.loss_kwargs.get('cosface')
|
|
181
|
+
loss_dict['loss_cosface'] = pairwise_cosface(
|
|
182
|
+
pred_features,
|
|
183
|
+
gt_labels,
|
|
184
|
+
cosface_kwargs.get('margin'),
|
|
185
|
+
cosface_kwargs.get('gamma'),
|
|
186
|
+
) * cosface_kwargs.get('scale')
|
|
187
|
+
|
|
188
|
+
return loss_dict
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: liaoxingyu
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
import torch
|
|
7
|
+
|
|
8
|
+
from fastreid.utils.registry import Registry
|
|
9
|
+
|
|
10
|
+
META_ARCH_REGISTRY = Registry("META_ARCH") # noqa F401 isort:skip
|
|
11
|
+
META_ARCH_REGISTRY.__doc__ = """
|
|
12
|
+
Registry for meta-architectures, i.e. the whole model.
|
|
13
|
+
The registered object will be called with `obj(cfg)`
|
|
14
|
+
and expected to return a `nn.Module` object.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def build_model(cfg):
|
|
19
|
+
"""
|
|
20
|
+
Build the whole model architecture, defined by ``cfg.MODEL.META_ARCHITECTURE``.
|
|
21
|
+
Note that it does not load any weights from ``cfg``.
|
|
22
|
+
"""
|
|
23
|
+
meta_arch = cfg.MODEL.META_ARCHITECTURE
|
|
24
|
+
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
|
|
25
|
+
model.to(torch.device(cfg.MODEL.DEVICE))
|
|
26
|
+
return model
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: l1aoxingyu
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
import torch
|
|
10
|
+
import torch.nn.functional as F
|
|
11
|
+
|
|
12
|
+
from fastreid.config import get_cfg
|
|
13
|
+
from fastreid.modeling.meta_arch import META_ARCH_REGISTRY, build_model, Baseline
|
|
14
|
+
from fastreid.utils.checkpoint import Checkpointer
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@META_ARCH_REGISTRY.register()
|
|
20
|
+
class Distiller(Baseline):
|
|
21
|
+
def __init__(self, cfg):
|
|
22
|
+
super().__init__(cfg)
|
|
23
|
+
|
|
24
|
+
# Get teacher model config
|
|
25
|
+
model_ts = []
|
|
26
|
+
for i in range(len(cfg.KD.MODEL_CONFIG)):
|
|
27
|
+
cfg_t = get_cfg()
|
|
28
|
+
cfg_t.merge_from_file(cfg.KD.MODEL_CONFIG[i])
|
|
29
|
+
cfg_t.defrost()
|
|
30
|
+
cfg_t.MODEL.META_ARCHITECTURE = "Baseline"
|
|
31
|
+
# Change syncBN to BN due to no DDP wrapper
|
|
32
|
+
if cfg_t.MODEL.BACKBONE.NORM == "syncBN":
|
|
33
|
+
cfg_t.MODEL.BACKBONE.NORM = "BN"
|
|
34
|
+
if cfg_t.MODEL.HEADS.NORM == "syncBN":
|
|
35
|
+
cfg_t.MODEL.HEADS.NORM = "BN"
|
|
36
|
+
|
|
37
|
+
model_t = build_model(cfg_t)
|
|
38
|
+
|
|
39
|
+
# No gradients for teacher model
|
|
40
|
+
for param in model_t.parameters():
|
|
41
|
+
param.requires_grad_(False)
|
|
42
|
+
|
|
43
|
+
logger.info("Loading teacher model weights ...")
|
|
44
|
+
Checkpointer(model_t).load(cfg.KD.MODEL_WEIGHTS[i])
|
|
45
|
+
|
|
46
|
+
model_ts.append(model_t)
|
|
47
|
+
|
|
48
|
+
self.ema_enabled = cfg.KD.EMA.ENABLED
|
|
49
|
+
self.ema_momentum = cfg.KD.EMA.MOMENTUM
|
|
50
|
+
if self.ema_enabled:
|
|
51
|
+
cfg_self = cfg.clone()
|
|
52
|
+
cfg_self.defrost()
|
|
53
|
+
cfg_self.MODEL.META_ARCHITECTURE = "Baseline"
|
|
54
|
+
if cfg_self.MODEL.BACKBONE.NORM == "syncBN":
|
|
55
|
+
cfg_self.MODEL.BACKBONE.NORM = "BN"
|
|
56
|
+
if cfg_self.MODEL.HEADS.NORM == "syncBN":
|
|
57
|
+
cfg_self.MODEL.HEADS.NORM = "BN"
|
|
58
|
+
model_self = build_model(cfg_self)
|
|
59
|
+
# No gradients for self model
|
|
60
|
+
for param in model_self.parameters():
|
|
61
|
+
param.requires_grad_(False)
|
|
62
|
+
|
|
63
|
+
if cfg_self.MODEL.WEIGHTS != '':
|
|
64
|
+
logger.info("Loading self distillation model weights ...")
|
|
65
|
+
Checkpointer(model_self).load(cfg_self.MODEL.WEIGHTS)
|
|
66
|
+
else:
|
|
67
|
+
# Make sure the initial state is same
|
|
68
|
+
for param_q, param_k in zip(self.parameters(), model_self.parameters()):
|
|
69
|
+
param_k.data.copy_(param_q.data)
|
|
70
|
+
|
|
71
|
+
model_ts.insert(0, model_self)
|
|
72
|
+
|
|
73
|
+
# Not register teacher model as `nn.Module`, this is
|
|
74
|
+
# make sure teacher model weights not saved
|
|
75
|
+
self.model_ts = model_ts
|
|
76
|
+
|
|
77
|
+
@torch.no_grad()
|
|
78
|
+
def _momentum_update_key_encoder(self, m=0.999):
|
|
79
|
+
"""
|
|
80
|
+
Momentum update of the key encoder
|
|
81
|
+
"""
|
|
82
|
+
for param_q, param_k in zip(self.parameters(), self.model_ts[0].parameters()):
|
|
83
|
+
param_k.data = param_k.data * m + param_q.data * (1. - m)
|
|
84
|
+
|
|
85
|
+
def forward(self, batched_inputs):
|
|
86
|
+
if self.training:
|
|
87
|
+
images = self.preprocess_image(batched_inputs)
|
|
88
|
+
# student model forward
|
|
89
|
+
s_feat = self.backbone(images)
|
|
90
|
+
assert "targets" in batched_inputs, "Labels are missing in training!"
|
|
91
|
+
targets = batched_inputs["targets"].to(self.device)
|
|
92
|
+
|
|
93
|
+
if targets.sum() < 0: targets.zero_()
|
|
94
|
+
|
|
95
|
+
s_outputs = self.heads(s_feat, targets)
|
|
96
|
+
|
|
97
|
+
t_outputs = []
|
|
98
|
+
# teacher model forward
|
|
99
|
+
with torch.no_grad():
|
|
100
|
+
if self.ema_enabled:
|
|
101
|
+
self._momentum_update_key_encoder(self.ema_momentum) # update self distill model
|
|
102
|
+
for model_t in self.model_ts:
|
|
103
|
+
t_feat = model_t.backbone(images)
|
|
104
|
+
t_output = model_t.heads(t_feat, targets)
|
|
105
|
+
t_outputs.append(t_output)
|
|
106
|
+
|
|
107
|
+
losses = self.losses(s_outputs, t_outputs, targets)
|
|
108
|
+
return losses
|
|
109
|
+
|
|
110
|
+
# Eval mode, just conventional reid feature extraction
|
|
111
|
+
else:
|
|
112
|
+
return super().forward(batched_inputs)
|
|
113
|
+
|
|
114
|
+
def losses(self, s_outputs, t_outputs, gt_labels):
|
|
115
|
+
"""
|
|
116
|
+
Compute loss from modeling's outputs, the loss function input arguments
|
|
117
|
+
must be the same as the outputs of the model forwarding.
|
|
118
|
+
"""
|
|
119
|
+
loss_dict = super().losses(s_outputs, gt_labels)
|
|
120
|
+
|
|
121
|
+
s_logits = s_outputs['pred_class_logits']
|
|
122
|
+
loss_jsdiv = 0.
|
|
123
|
+
for t_output in t_outputs:
|
|
124
|
+
t_logits = t_output['pred_class_logits'].detach()
|
|
125
|
+
loss_jsdiv += self.jsdiv_loss(s_logits, t_logits)
|
|
126
|
+
|
|
127
|
+
loss_dict["loss_jsdiv"] = loss_jsdiv / len(t_outputs)
|
|
128
|
+
|
|
129
|
+
return loss_dict
|
|
130
|
+
|
|
131
|
+
@staticmethod
|
|
132
|
+
def _kldiv(y_s, y_t, t):
|
|
133
|
+
p_s = F.log_softmax(y_s / t, dim=1)
|
|
134
|
+
p_t = F.softmax(y_t / t, dim=1)
|
|
135
|
+
loss = F.kl_div(p_s, p_t, reduction="sum") * (t ** 2) / y_s.shape[0]
|
|
136
|
+
return loss
|
|
137
|
+
|
|
138
|
+
def jsdiv_loss(self, y_s, y_t, t=16):
|
|
139
|
+
loss = (self._kldiv(y_s, y_t, t) + self._kldiv(y_t, y_s, t)) / 2
|
|
140
|
+
return loss
|