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,246 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: xingyu liao
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
# based on:
|
|
7
|
+
# https://github.com/pytorch/contrib/blob/master/torchcontrib/optim/swa.py
|
|
8
|
+
|
|
9
|
+
import warnings
|
|
10
|
+
from collections import defaultdict
|
|
11
|
+
|
|
12
|
+
import torch
|
|
13
|
+
from torch.optim.optimizer import Optimizer
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SWA(Optimizer):
|
|
17
|
+
def __init__(self, optimizer, swa_freq=None, swa_lr_factor=None):
|
|
18
|
+
r"""Implements Stochastic Weight Averaging (SWA).
|
|
19
|
+
Stochastic Weight Averaging was proposed in `Averaging Weights Leads to
|
|
20
|
+
Wider Optima and Better Generalization`_ by Pavel Izmailov, Dmitrii
|
|
21
|
+
Podoprikhin, Timur Garipov, Dmitry Vetrov and Andrew Gordon Wilson
|
|
22
|
+
(UAI 2018).
|
|
23
|
+
SWA is implemented as a wrapper class taking optimizer instance as input
|
|
24
|
+
and applying SWA on top of that optimizer.
|
|
25
|
+
SWA can be used in two modes: automatic and manual. In the automatic
|
|
26
|
+
mode SWA running averages are automatically updated every
|
|
27
|
+
:attr:`swa_freq` steps after :attr:`swa_start` steps of optimization. If
|
|
28
|
+
:attr:`swa_lr` is provided, the learning rate of the optimizer is reset
|
|
29
|
+
to :attr:`swa_lr` at every step starting from :attr:`swa_start`. To use
|
|
30
|
+
SWA in automatic mode provide values for both :attr:`swa_start` and
|
|
31
|
+
:attr:`swa_freq` arguments.
|
|
32
|
+
Alternatively, in the manual mode, use :meth:`update_swa` or
|
|
33
|
+
:meth:`update_swa_group` methods to update the SWA running averages.
|
|
34
|
+
In the end of training use `swap_swa_sgd` method to set the optimized
|
|
35
|
+
variables to the computed averages.
|
|
36
|
+
Args:
|
|
37
|
+
swa_freq (int): number of steps between subsequent updates of
|
|
38
|
+
SWA running averages in automatic mode; if None, manual mode is
|
|
39
|
+
selected (default: None)
|
|
40
|
+
swa_lr (float): learning rate to use starting from step swa_start
|
|
41
|
+
in automatic mode; if None, learning rate is not changed
|
|
42
|
+
(default: None)
|
|
43
|
+
Examples:
|
|
44
|
+
>>> # automatic mode
|
|
45
|
+
>>> base_opt = torch.optim.SGD(model.parameters(), lr=0.1)
|
|
46
|
+
>>> opt = SWA(base_opt, swa_start=10, swa_freq=5, swa_lr=0.05)
|
|
47
|
+
>>> for _ in range(100):
|
|
48
|
+
>>> opt.zero_grad()
|
|
49
|
+
>>> loss_fn(model(input), target).backward()
|
|
50
|
+
>>> opt.step()
|
|
51
|
+
>>> opt.swap_swa_param()
|
|
52
|
+
>>> # manual mode
|
|
53
|
+
>>> opt = SWA(base_opt)
|
|
54
|
+
>>> for i in range(100):
|
|
55
|
+
>>> opt.zero_grad()
|
|
56
|
+
>>> loss_fn(model(input), target).backward()
|
|
57
|
+
>>> opt.step()
|
|
58
|
+
>>> if i > 10 and i % 5 == 0:
|
|
59
|
+
>>> opt.update_swa()
|
|
60
|
+
>>> opt.swap_swa_param()
|
|
61
|
+
.. note::
|
|
62
|
+
SWA does not support parameter-specific values of :attr:`swa_start`,
|
|
63
|
+
:attr:`swa_freq` or :attr:`swa_lr`. In automatic mode SWA uses the
|
|
64
|
+
same :attr:`swa_start`, :attr:`swa_freq` and :attr:`swa_lr` for all
|
|
65
|
+
parameter groups. If needed, use manual mode with
|
|
66
|
+
:meth:`update_swa_group` to use different update schedules for
|
|
67
|
+
different parameter groups.
|
|
68
|
+
.. note::
|
|
69
|
+
Call :meth:`swap_swa_sgd` in the end of training to use the computed
|
|
70
|
+
running averages.
|
|
71
|
+
.. note::
|
|
72
|
+
If you are using SWA to optimize the parameters of a Neural Network
|
|
73
|
+
containing Batch Normalization layers, you need to update the
|
|
74
|
+
:attr:`running_mean` and :attr:`running_var` statistics of the
|
|
75
|
+
Batch Normalization module. You can do so by using
|
|
76
|
+
`torchcontrib.optim.swa.bn_update` utility.
|
|
77
|
+
.. note::
|
|
78
|
+
See the blogpost
|
|
79
|
+
https://pytorch.org/blog/stochastic-weight-averaging-in-pytorch/
|
|
80
|
+
for an extended description of this SWA implementation.
|
|
81
|
+
.. note::
|
|
82
|
+
The repo https://github.com/izmailovpavel/contrib_swa_examples
|
|
83
|
+
contains examples of using this SWA implementation.
|
|
84
|
+
.. _Averaging Weights Leads to Wider Optima and Better Generalization:
|
|
85
|
+
https://arxiv.org/abs/1803.05407
|
|
86
|
+
.. _Improving Consistency-Based Semi-Supervised Learning with Weight
|
|
87
|
+
Averaging:
|
|
88
|
+
https://arxiv.org/abs/1806.05594
|
|
89
|
+
"""
|
|
90
|
+
self._auto_mode, (self.swa_freq,) = self._check_params(swa_freq)
|
|
91
|
+
self.swa_lr_factor = swa_lr_factor
|
|
92
|
+
|
|
93
|
+
if self._auto_mode:
|
|
94
|
+
if swa_freq < 1:
|
|
95
|
+
raise ValueError("Invalid swa_freq: {}".format(swa_freq))
|
|
96
|
+
else:
|
|
97
|
+
if self.swa_lr_factor is not None:
|
|
98
|
+
warnings.warn(
|
|
99
|
+
"Swa_freq is None, ignoring swa_lr")
|
|
100
|
+
# If not in auto mode make all swa parameters None
|
|
101
|
+
self.swa_lr_factor = None
|
|
102
|
+
self.swa_freq = None
|
|
103
|
+
|
|
104
|
+
if self.swa_lr_factor is not None and self.swa_lr_factor < 0:
|
|
105
|
+
raise ValueError("Invalid SWA learning rate factor: {}".format(swa_lr_factor))
|
|
106
|
+
|
|
107
|
+
self.optimizer = optimizer
|
|
108
|
+
|
|
109
|
+
self.defaults = self.optimizer.defaults
|
|
110
|
+
self.param_groups = self.optimizer.param_groups
|
|
111
|
+
self.state = defaultdict(dict)
|
|
112
|
+
self.opt_state = self.optimizer.state
|
|
113
|
+
for group in self.param_groups:
|
|
114
|
+
group['n_avg'] = 0
|
|
115
|
+
group['step_counter'] = 0
|
|
116
|
+
|
|
117
|
+
@staticmethod
|
|
118
|
+
def _check_params(swa_freq):
|
|
119
|
+
params = [swa_freq]
|
|
120
|
+
params_none = [param is None for param in params]
|
|
121
|
+
if not all(params_none) and any(params_none):
|
|
122
|
+
warnings.warn(
|
|
123
|
+
"Some of swa_start, swa_freq is None, ignoring other")
|
|
124
|
+
for i, param in enumerate(params):
|
|
125
|
+
if param is not None and not isinstance(param, int):
|
|
126
|
+
params[i] = int(param)
|
|
127
|
+
warnings.warn("Casting swa_start, swa_freq to int")
|
|
128
|
+
return not any(params_none), params
|
|
129
|
+
|
|
130
|
+
def reset_lr_to_swa(self):
|
|
131
|
+
for param_group in self.param_groups:
|
|
132
|
+
param_group['initial_lr'] = self.swa_lr_factor * param_group['lr']
|
|
133
|
+
|
|
134
|
+
def update_swa_group(self, group):
|
|
135
|
+
r"""Updates the SWA running averages for the given parameter group.
|
|
136
|
+
Arguments:
|
|
137
|
+
group (dict): Specifies for what parameter group SWA running
|
|
138
|
+
averages should be updated
|
|
139
|
+
Examples:
|
|
140
|
+
>>> # automatic mode
|
|
141
|
+
>>> base_opt = torch.optim.SGD([{'params': [x]},
|
|
142
|
+
>>> {'params': [y], 'lr': 1e-3}], lr=1e-2, momentum=0.9)
|
|
143
|
+
>>> opt = torchcontrib.optim.SWA(base_opt)
|
|
144
|
+
>>> for i in range(100):
|
|
145
|
+
>>> opt.zero_grad()
|
|
146
|
+
>>> loss_fn(model(input), target).backward()
|
|
147
|
+
>>> opt.step()
|
|
148
|
+
>>> if i > 10 and i % 5 == 0:
|
|
149
|
+
>>> # Update SWA for the second parameter group
|
|
150
|
+
>>> opt.update_swa_group(opt.param_groups[1])
|
|
151
|
+
>>> opt.swap_swa_param()
|
|
152
|
+
"""
|
|
153
|
+
for p in group['params']:
|
|
154
|
+
param_state = self.state[p]
|
|
155
|
+
if 'swa_buffer' not in param_state:
|
|
156
|
+
param_state['swa_buffer'] = torch.zeros_like(p.data)
|
|
157
|
+
buf = param_state['swa_buffer']
|
|
158
|
+
virtual_decay = 1 / float(group["n_avg"] + 1)
|
|
159
|
+
diff = (p.data - buf) * virtual_decay
|
|
160
|
+
buf.add_(diff)
|
|
161
|
+
group["n_avg"] += 1
|
|
162
|
+
|
|
163
|
+
def update_swa(self):
|
|
164
|
+
r"""Updates the SWA running averages of all optimized parameters.
|
|
165
|
+
"""
|
|
166
|
+
for group in self.param_groups:
|
|
167
|
+
self.update_swa_group(group)
|
|
168
|
+
|
|
169
|
+
def swap_swa_param(self):
|
|
170
|
+
r"""Swaps the values of the optimized variables and swa buffers.
|
|
171
|
+
It's meant to be called in the end of training to use the collected
|
|
172
|
+
swa running averages. It can also be used to evaluate the running
|
|
173
|
+
averages during training; to continue training `swap_swa_sgd`
|
|
174
|
+
should be called again.
|
|
175
|
+
"""
|
|
176
|
+
for group in self.param_groups:
|
|
177
|
+
for p in group['params']:
|
|
178
|
+
param_state = self.state[p]
|
|
179
|
+
if 'swa_buffer' not in param_state:
|
|
180
|
+
# If swa wasn't applied we don't swap params
|
|
181
|
+
warnings.warn(
|
|
182
|
+
"SWA wasn't applied to param {}; skipping it".format(p))
|
|
183
|
+
continue
|
|
184
|
+
buf = param_state['swa_buffer']
|
|
185
|
+
tmp = torch.empty_like(p.data)
|
|
186
|
+
tmp.copy_(p.data)
|
|
187
|
+
p.data.copy_(buf)
|
|
188
|
+
buf.copy_(tmp)
|
|
189
|
+
|
|
190
|
+
def step(self, closure=None):
|
|
191
|
+
r"""Performs a single optimization step.
|
|
192
|
+
In automatic mode also updates SWA running averages.
|
|
193
|
+
"""
|
|
194
|
+
loss = self.optimizer.step(closure)
|
|
195
|
+
for group in self.param_groups:
|
|
196
|
+
group["step_counter"] += 1
|
|
197
|
+
steps = group["step_counter"]
|
|
198
|
+
if self._auto_mode:
|
|
199
|
+
if steps % self.swa_freq == 0:
|
|
200
|
+
self.update_swa_group(group)
|
|
201
|
+
return loss
|
|
202
|
+
|
|
203
|
+
def state_dict(self):
|
|
204
|
+
r"""Returns the state of SWA as a :class:`dict`.
|
|
205
|
+
It contains three entries:
|
|
206
|
+
* opt_state - a dict holding current optimization state of the base
|
|
207
|
+
optimizer. Its content differs between optimizer classes.
|
|
208
|
+
* swa_state - a dict containing current state of SWA. For each
|
|
209
|
+
optimized variable it contains swa_buffer keeping the running
|
|
210
|
+
average of the variable
|
|
211
|
+
* param_groups - a dict containing all parameter groups
|
|
212
|
+
"""
|
|
213
|
+
opt_state_dict = self.optimizer.state_dict()
|
|
214
|
+
swa_state = {(id(k) if isinstance(k, torch.Tensor) else k): v
|
|
215
|
+
for k, v in self.state.items()}
|
|
216
|
+
opt_state = opt_state_dict["state"]
|
|
217
|
+
param_groups = opt_state_dict["param_groups"]
|
|
218
|
+
return {"opt_state": opt_state, "swa_state": swa_state,
|
|
219
|
+
"param_groups": param_groups}
|
|
220
|
+
|
|
221
|
+
def load_state_dict(self, state_dict):
|
|
222
|
+
r"""Loads the optimizer state.
|
|
223
|
+
Args:
|
|
224
|
+
state_dict (dict): SWA optimizer state. Should be an object returned
|
|
225
|
+
from a call to `state_dict`.
|
|
226
|
+
"""
|
|
227
|
+
swa_state_dict = {"state": state_dict["swa_state"],
|
|
228
|
+
"param_groups": state_dict["param_groups"]}
|
|
229
|
+
opt_state_dict = {"state": state_dict["opt_state"],
|
|
230
|
+
"param_groups": state_dict["param_groups"]}
|
|
231
|
+
super(SWA, self).load_state_dict(swa_state_dict)
|
|
232
|
+
self.optimizer.load_state_dict(opt_state_dict)
|
|
233
|
+
self.opt_state = self.optimizer.state
|
|
234
|
+
|
|
235
|
+
def add_param_group(self, param_group):
|
|
236
|
+
r"""Add a param group to the :class:`Optimizer` s `param_groups`.
|
|
237
|
+
This can be useful when fine tuning a pre-trained network as frozen
|
|
238
|
+
layers can be made trainable and added to the :class:`Optimizer` as
|
|
239
|
+
training progresses.
|
|
240
|
+
Args:
|
|
241
|
+
param_group (dict): Specifies what Tensors should be optimized along
|
|
242
|
+
with group specific optimization options.
|
|
243
|
+
"""
|
|
244
|
+
param_group['n_avg'] = 0
|
|
245
|
+
param_group['step_counter'] = 0
|
|
246
|
+
self.optimizer.add_param_group(param_group)
|