dnt 0.2.4__py3-none-any.whl → 0.3.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dnt might be problematic. Click here for more details.
- dnt/__init__.py +3 -2
- dnt/analysis/__init__.py +3 -2
- dnt/analysis/interaction.py +503 -0
- dnt/analysis/stop.py +22 -17
- dnt/analysis/stop2.py +289 -0
- dnt/analysis/stop3.py +754 -0
- dnt/detect/signal/detector.py +317 -0
- dnt/detect/yolov8/detector.py +116 -16
- dnt/engine/__init__.py +8 -0
- dnt/engine/bbox_interp.py +83 -0
- dnt/engine/bbox_iou.py +20 -0
- dnt/engine/cluster.py +31 -0
- dnt/engine/iob.py +66 -0
- dnt/filter/filter.py +321 -1
- dnt/label/labeler.py +4 -4
- dnt/label/labeler2.py +502 -0
- dnt/shared/__init__.py +2 -1
- dnt/shared/data/coco.names +0 -0
- dnt/shared/data/openimages.names +0 -0
- dnt/shared/data/voc.names +0 -0
- dnt/shared/download.py +12 -0
- dnt/shared/synhcro.py +150 -0
- dnt/shared/util.py +17 -4
- dnt/third_party/fast-reid/__init__.py +1 -0
- dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
- dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
- dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
- dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
- dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
- dnt/third_party/fast-reid/configs/__init__.py +0 -0
- dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
- dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
- dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
- dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
- dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
- dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
- dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
- dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
- dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
- dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
- dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
- dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
- dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
- dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
- dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
- dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
- dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
- dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
- dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
- dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
- dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
- dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
- dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
- dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
- dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
- dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
- dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
- dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
- dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
- dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
- dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
- dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
- dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
- dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
- dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
- dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
- dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
- dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
- dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
- dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
- dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
- dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
- dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
- dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
- dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
- dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
- dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
- dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
- dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
- dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
- dnt/track/__init__.py +2 -0
- dnt/track/botsort/__init__.py +4 -0
- dnt/track/botsort/bot_tracker/__init__.py +3 -0
- dnt/track/botsort/bot_tracker/basetrack.py +60 -0
- dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
- dnt/track/botsort/bot_tracker/gmc.py +316 -0
- dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
- dnt/track/botsort/bot_tracker/matching.py +194 -0
- dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/io.py +19 -36
- dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
- dnt/track/botsort/inference.py +96 -0
- dnt/track/config.py +120 -0
- dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
- dnt/track/dsort/configs/deep_sort.yaml +0 -0
- dnt/track/dsort/configs/fastreid.yaml +1 -1
- dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
- dnt/track/dsort/deep_sort/deep/feature_extractor.py +87 -8
- dnt/track/dsort/deep_sort/deep_sort.py +28 -18
- dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
- dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
- dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
- dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
- dnt/track/dsort/dsort.py +21 -28
- dnt/track/re_class.py +94 -0
- dnt/track/sort/sort.py +5 -1
- dnt/track/tracker.py +207 -30
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/METADATA +30 -10
- dnt-0.3.1.3.dist-info/RECORD +314 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/WHEEL +1 -1
- dnt/analysis/yield.py +0 -9
- dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
- dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
- dnt/track/dsort/deep_sort/deep/test.py +0 -77
- dnt/track/dsort/deep_sort/deep/train.py +0 -189
- dnt/track/dsort/utils/asserts.py +0 -13
- dnt/track/dsort/utils/draw.py +0 -36
- dnt/track/dsort/utils/json_logger.py +0 -383
- dnt/track/dsort/utils/log.py +0 -17
- dnt/track/dsort/utils/parser.py +0 -35
- dnt/track/dsort/utils/tools.py +0 -39
- dnt-0.2.4.dist-info/RECORD +0 -64
- /dnt/{track/dsort/utils → third_party/fast-reid/checkpoint}/__init__.py +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/LICENSE +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# !/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
#
|
|
5
|
+
# This source code is licensed under the MIT license found in the
|
|
6
|
+
# LICENSE file in the root directory of this source tree.
|
|
7
|
+
|
|
8
|
+
"""EfficientNet models."""
|
|
9
|
+
|
|
10
|
+
import logging
|
|
11
|
+
|
|
12
|
+
import torch
|
|
13
|
+
import torch.nn as nn
|
|
14
|
+
|
|
15
|
+
from fastreid.layers import *
|
|
16
|
+
from fastreid.modeling.backbones.build import BACKBONE_REGISTRY
|
|
17
|
+
from fastreid.utils import comm
|
|
18
|
+
from fastreid.utils.checkpoint import get_missing_parameters_message, get_unexpected_parameters_message
|
|
19
|
+
from .config import cfg as effnet_cfg
|
|
20
|
+
from .regnet import drop_connect, init_weights
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
model_urls = {
|
|
24
|
+
'b0': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161305613/EN-B0_dds_8gpu.pyth',
|
|
25
|
+
'b1': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161304979/EN-B1_dds_8gpu.pyth',
|
|
26
|
+
'b2': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161305015/EN-B2_dds_8gpu.pyth',
|
|
27
|
+
'b3': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161304979/EN-B3_dds_8gpu.pyth',
|
|
28
|
+
'b4': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161305098/EN-B4_dds_8gpu.pyth',
|
|
29
|
+
'b5': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161304979/EN-B5_dds_8gpu.pyth',
|
|
30
|
+
'b6': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161304979/EN-B6_dds_8gpu.pyth',
|
|
31
|
+
'b7': 'https://dl.fbaipublicfiles.com/pycls/dds_baselines/161304979/EN-B7_dds_8gpu.pyth',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class EffHead(nn.Module):
|
|
36
|
+
"""EfficientNet head: 1x1, BN, Swish, AvgPool, Dropout, FC."""
|
|
37
|
+
|
|
38
|
+
def __init__(self, w_in, w_out, bn_norm):
|
|
39
|
+
super(EffHead, self).__init__()
|
|
40
|
+
self.conv = nn.Conv2d(w_in, w_out, 1, stride=1, padding=0, bias=False)
|
|
41
|
+
self.conv_bn = get_norm(bn_norm, w_out)
|
|
42
|
+
self.conv_swish = Swish()
|
|
43
|
+
|
|
44
|
+
def forward(self, x):
|
|
45
|
+
x = self.conv_swish(self.conv_bn(self.conv(x)))
|
|
46
|
+
return x
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Swish(nn.Module):
|
|
50
|
+
"""Swish activation function: x * sigmoid(x)."""
|
|
51
|
+
|
|
52
|
+
def __init__(self):
|
|
53
|
+
super(Swish, self).__init__()
|
|
54
|
+
|
|
55
|
+
def forward(self, x):
|
|
56
|
+
return x * torch.sigmoid(x)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class SE(nn.Module):
|
|
60
|
+
"""Squeeze-and-Excitation (SE) block w/ Swish: AvgPool, FC, Swish, FC, Sigmoid."""
|
|
61
|
+
|
|
62
|
+
def __init__(self, w_in, w_se):
|
|
63
|
+
super(SE, self).__init__()
|
|
64
|
+
self.avg_pool = nn.AdaptiveAvgPool2d((1, 1))
|
|
65
|
+
self.f_ex = nn.Sequential(
|
|
66
|
+
nn.Conv2d(w_in, w_se, 1, bias=True),
|
|
67
|
+
Swish(),
|
|
68
|
+
nn.Conv2d(w_se, w_in, 1, bias=True),
|
|
69
|
+
nn.Sigmoid(),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def forward(self, x):
|
|
73
|
+
return x * self.f_ex(self.avg_pool(x))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class MBConv(nn.Module):
|
|
77
|
+
"""Mobile inverted bottleneck block w/ SE (MBConv)."""
|
|
78
|
+
|
|
79
|
+
def __init__(self, w_in, exp_r, kernel, stride, se_r, w_out, bn_norm):
|
|
80
|
+
# expansion, 3x3 dwise, BN, Swish, SE, 1x1, BN, skip_connection
|
|
81
|
+
super(MBConv, self).__init__()
|
|
82
|
+
self.exp = None
|
|
83
|
+
w_exp = int(w_in * exp_r)
|
|
84
|
+
if w_exp != w_in:
|
|
85
|
+
self.exp = nn.Conv2d(w_in, w_exp, 1, stride=1, padding=0, bias=False)
|
|
86
|
+
self.exp_bn = get_norm(bn_norm, w_exp)
|
|
87
|
+
self.exp_swish = Swish()
|
|
88
|
+
dwise_args = {"groups": w_exp, "padding": (kernel - 1) // 2, "bias": False}
|
|
89
|
+
self.dwise = nn.Conv2d(w_exp, w_exp, kernel, stride=stride, **dwise_args)
|
|
90
|
+
self.dwise_bn = get_norm(bn_norm, w_exp)
|
|
91
|
+
self.dwise_swish = Swish()
|
|
92
|
+
self.se = SE(w_exp, int(w_in * se_r))
|
|
93
|
+
self.lin_proj = nn.Conv2d(w_exp, w_out, 1, stride=1, padding=0, bias=False)
|
|
94
|
+
self.lin_proj_bn = get_norm(bn_norm, w_out)
|
|
95
|
+
# Skip connection if in and out shapes are the same (MN-V2 style)
|
|
96
|
+
self.has_skip = stride == 1 and w_in == w_out
|
|
97
|
+
|
|
98
|
+
def forward(self, x):
|
|
99
|
+
f_x = x
|
|
100
|
+
if self.exp:
|
|
101
|
+
f_x = self.exp_swish(self.exp_bn(self.exp(f_x)))
|
|
102
|
+
f_x = self.dwise_swish(self.dwise_bn(self.dwise(f_x)))
|
|
103
|
+
f_x = self.se(f_x)
|
|
104
|
+
f_x = self.lin_proj_bn(self.lin_proj(f_x))
|
|
105
|
+
if self.has_skip:
|
|
106
|
+
if self.training and effnet_cfg.EN.DC_RATIO > 0.0:
|
|
107
|
+
f_x = drop_connect(f_x, effnet_cfg.EN.DC_RATIO)
|
|
108
|
+
f_x = x + f_x
|
|
109
|
+
return f_x
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class EffStage(nn.Module):
|
|
113
|
+
"""EfficientNet stage."""
|
|
114
|
+
|
|
115
|
+
def __init__(self, w_in, exp_r, kernel, stride, se_r, w_out, d, bn_norm):
|
|
116
|
+
super(EffStage, self).__init__()
|
|
117
|
+
for i in range(d):
|
|
118
|
+
b_stride = stride if i == 0 else 1
|
|
119
|
+
b_w_in = w_in if i == 0 else w_out
|
|
120
|
+
name = "b{}".format(i + 1)
|
|
121
|
+
self.add_module(name, MBConv(b_w_in, exp_r, kernel, b_stride, se_r, w_out, bn_norm))
|
|
122
|
+
|
|
123
|
+
def forward(self, x):
|
|
124
|
+
for block in self.children():
|
|
125
|
+
x = block(x)
|
|
126
|
+
return x
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class StemIN(nn.Module):
|
|
130
|
+
"""EfficientNet stem for ImageNet: 3x3, BN, Swish."""
|
|
131
|
+
|
|
132
|
+
def __init__(self, w_in, w_out, bn_norm):
|
|
133
|
+
super(StemIN, self).__init__()
|
|
134
|
+
self.conv = nn.Conv2d(w_in, w_out, 3, stride=2, padding=1, bias=False)
|
|
135
|
+
self.bn = get_norm(bn_norm, w_out)
|
|
136
|
+
self.swish = Swish()
|
|
137
|
+
|
|
138
|
+
def forward(self, x):
|
|
139
|
+
for layer in self.children():
|
|
140
|
+
x = layer(x)
|
|
141
|
+
return x
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class EffNet(nn.Module):
|
|
145
|
+
"""EfficientNet model."""
|
|
146
|
+
|
|
147
|
+
@staticmethod
|
|
148
|
+
def get_args():
|
|
149
|
+
return {
|
|
150
|
+
"stem_w": effnet_cfg.EN.STEM_W,
|
|
151
|
+
"ds": effnet_cfg.EN.DEPTHS,
|
|
152
|
+
"ws": effnet_cfg.EN.WIDTHS,
|
|
153
|
+
"exp_rs": effnet_cfg.EN.EXP_RATIOS,
|
|
154
|
+
"se_r": effnet_cfg.EN.SE_R,
|
|
155
|
+
"ss": effnet_cfg.EN.STRIDES,
|
|
156
|
+
"ks": effnet_cfg.EN.KERNELS,
|
|
157
|
+
"head_w": effnet_cfg.EN.HEAD_W,
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
def __init__(self, last_stride, bn_norm, **kwargs):
|
|
161
|
+
super(EffNet, self).__init__()
|
|
162
|
+
kwargs = self.get_args() if not kwargs else kwargs
|
|
163
|
+
self._construct(**kwargs, last_stride=last_stride, bn_norm=bn_norm)
|
|
164
|
+
self.apply(init_weights)
|
|
165
|
+
|
|
166
|
+
def _construct(self, stem_w, ds, ws, exp_rs, se_r, ss, ks, head_w, last_stride, bn_norm):
|
|
167
|
+
stage_params = list(zip(ds, ws, exp_rs, ss, ks))
|
|
168
|
+
self.stem = StemIN(3, stem_w, bn_norm)
|
|
169
|
+
prev_w = stem_w
|
|
170
|
+
for i, (d, w, exp_r, stride, kernel) in enumerate(stage_params):
|
|
171
|
+
name = "s{}".format(i + 1)
|
|
172
|
+
if i == 5: stride = last_stride
|
|
173
|
+
self.add_module(name, EffStage(prev_w, exp_r, kernel, stride, se_r, w, d, bn_norm))
|
|
174
|
+
prev_w = w
|
|
175
|
+
self.head = EffHead(prev_w, head_w, bn_norm)
|
|
176
|
+
|
|
177
|
+
def forward(self, x):
|
|
178
|
+
for module in self.children():
|
|
179
|
+
x = module(x)
|
|
180
|
+
return x
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def init_pretrained_weights(key):
|
|
184
|
+
"""Initializes model with pretrained weights.
|
|
185
|
+
|
|
186
|
+
Layers that don't match with pretrained layers in name or size are kept unchanged.
|
|
187
|
+
"""
|
|
188
|
+
import os
|
|
189
|
+
import errno
|
|
190
|
+
import gdown
|
|
191
|
+
|
|
192
|
+
def _get_torch_home():
|
|
193
|
+
ENV_TORCH_HOME = 'TORCH_HOME'
|
|
194
|
+
ENV_XDG_CACHE_HOME = 'XDG_CACHE_HOME'
|
|
195
|
+
DEFAULT_CACHE_DIR = '~/.cache'
|
|
196
|
+
torch_home = os.path.expanduser(
|
|
197
|
+
os.getenv(
|
|
198
|
+
ENV_TORCH_HOME,
|
|
199
|
+
os.path.join(
|
|
200
|
+
os.getenv(ENV_XDG_CACHE_HOME, DEFAULT_CACHE_DIR), 'torch'
|
|
201
|
+
)
|
|
202
|
+
)
|
|
203
|
+
)
|
|
204
|
+
return torch_home
|
|
205
|
+
|
|
206
|
+
torch_home = _get_torch_home()
|
|
207
|
+
model_dir = os.path.join(torch_home, 'checkpoints')
|
|
208
|
+
try:
|
|
209
|
+
os.makedirs(model_dir)
|
|
210
|
+
except OSError as e:
|
|
211
|
+
if e.errno == errno.EEXIST:
|
|
212
|
+
# Directory already exists, ignore.
|
|
213
|
+
pass
|
|
214
|
+
else:
|
|
215
|
+
# Unexpected OSError, re-raise.
|
|
216
|
+
raise
|
|
217
|
+
|
|
218
|
+
filename = model_urls[key].split('/')[-1]
|
|
219
|
+
|
|
220
|
+
cached_file = os.path.join(model_dir, filename)
|
|
221
|
+
|
|
222
|
+
if not os.path.exists(cached_file):
|
|
223
|
+
if comm.is_main_process():
|
|
224
|
+
gdown.download(model_urls[key], cached_file, quiet=False)
|
|
225
|
+
|
|
226
|
+
comm.synchronize()
|
|
227
|
+
|
|
228
|
+
logger.info(f"Loading pretrained model from {cached_file}")
|
|
229
|
+
state_dict = torch.load(cached_file, map_location=torch.device("cpu"))["model_state"]
|
|
230
|
+
|
|
231
|
+
return state_dict
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@BACKBONE_REGISTRY.register()
|
|
235
|
+
def build_effnet_backbone(cfg):
|
|
236
|
+
# fmt: off
|
|
237
|
+
pretrain = cfg.MODEL.BACKBONE.PRETRAIN
|
|
238
|
+
pretrain_path = cfg.MODEL.BACKBONE.PRETRAIN_PATH
|
|
239
|
+
last_stride = cfg.MODEL.BACKBONE.LAST_STRIDE
|
|
240
|
+
bn_norm = cfg.MODEL.BACKBONE.NORM
|
|
241
|
+
depth = cfg.MODEL.BACKBONE.DEPTH
|
|
242
|
+
# fmt: on
|
|
243
|
+
|
|
244
|
+
cfg_files = {
|
|
245
|
+
'b0': 'fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml',
|
|
246
|
+
'b1': 'fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml',
|
|
247
|
+
'b2': 'fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml',
|
|
248
|
+
'b3': 'fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml',
|
|
249
|
+
'b4': 'fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml',
|
|
250
|
+
'b5': 'fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml',
|
|
251
|
+
}[depth]
|
|
252
|
+
|
|
253
|
+
effnet_cfg.merge_from_file(cfg_files)
|
|
254
|
+
model = EffNet(last_stride, bn_norm)
|
|
255
|
+
|
|
256
|
+
if pretrain:
|
|
257
|
+
# Load pretrain path if specifically
|
|
258
|
+
if pretrain_path:
|
|
259
|
+
try:
|
|
260
|
+
state_dict = torch.load(pretrain_path, map_location=torch.device('cpu'))["model_state"]
|
|
261
|
+
logger.info(f"Loading pretrained model from {pretrain_path}")
|
|
262
|
+
except FileNotFoundError as e:
|
|
263
|
+
logger.info(f'{pretrain_path} is not found! Please check this path.')
|
|
264
|
+
raise e
|
|
265
|
+
except KeyError as e:
|
|
266
|
+
logger.info("State dict keys error! Please check the state dict.")
|
|
267
|
+
raise e
|
|
268
|
+
else:
|
|
269
|
+
key = depth
|
|
270
|
+
state_dict = init_pretrained_weights(key)
|
|
271
|
+
|
|
272
|
+
incompatible = model.load_state_dict(state_dict, strict=False)
|
|
273
|
+
if incompatible.missing_keys:
|
|
274
|
+
logger.info(
|
|
275
|
+
get_missing_parameters_message(incompatible.missing_keys)
|
|
276
|
+
)
|
|
277
|
+
if incompatible.unexpected_keys:
|
|
278
|
+
logger.info(
|
|
279
|
+
get_unexpected_parameters_message(incompatible.unexpected_keys)
|
|
280
|
+
)
|
|
281
|
+
return model
|