dnt 0.2.1__py3-none-any.whl → 0.3.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dnt/__init__.py +4 -1
- dnt/analysis/__init__.py +3 -1
- dnt/analysis/count.py +107 -0
- dnt/analysis/interaction2.py +518 -0
- dnt/analysis/position.py +12 -0
- dnt/analysis/stop.py +92 -33
- dnt/analysis/stop2.py +289 -0
- dnt/analysis/stop3.py +758 -0
- dnt/detect/__init__.py +1 -1
- dnt/detect/signal/detector.py +326 -0
- dnt/detect/timestamp.py +105 -0
- dnt/detect/yolov8/detector.py +182 -35
- dnt/detect/yolov8/segmentor.py +171 -0
- 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/__init__.py +4 -0
- dnt/filter/filter.py +450 -21
- dnt/label/__init__.py +1 -1
- dnt/label/labeler.py +215 -14
- dnt/label/labeler2.py +631 -0
- dnt/shared/__init__.py +2 -1
- dnt/shared/data/coco.names +0 -0
- dnt/shared/data/openimages.names +0 -0
- dnt/shared/data/voc.names +0 -0
- dnt/shared/download.py +12 -0
- dnt/shared/synhcro.py +150 -0
- dnt/shared/util.py +17 -4
- dnt/third_party/fast-reid/__init__.py +1 -0
- dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
- dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
- dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
- dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
- dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
- dnt/third_party/fast-reid/configs/__init__.py +0 -0
- dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
- dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
- dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
- dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
- dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
- dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
- dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
- dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
- dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
- dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
- dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
- dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
- dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
- dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
- dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
- dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
- dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
- dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
- dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
- dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
- dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
- dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
- dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
- dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
- dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
- dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
- dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
- dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
- dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
- dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
- dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
- dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
- dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
- dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
- dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
- dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
- dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
- dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
- dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
- dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
- dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
- dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
- dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
- dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
- dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
- dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
- dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
- dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
- dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
- dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
- dnt/track/__init__.py +3 -1
- 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 -21
- 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 +44 -27
- dnt/track/re_class.py +117 -0
- dnt/track/sort/sort.py +9 -7
- dnt/track/tracker.py +225 -20
- dnt-0.3.1.8.dist-info/METADATA +117 -0
- dnt-0.3.1.8.dist-info/RECORD +315 -0
- {dnt-0.2.1.dist-info → dnt-0.3.1.8.dist-info}/WHEEL +1 -1
- 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.1.dist-info/METADATA +0 -35
- dnt-0.2.1.dist-info/RECORD +0 -60
- /dnt/{track/dsort/utils → third_party/fast-reid/checkpoint}/__init__.py +0 -0
- {dnt-0.2.1.dist-info → dnt-0.3.1.8.dist-info/licenses}/LICENSE +0 -0
- {dnt-0.2.1.dist-info → dnt-0.3.1.8.dist-info}/top_level.txt +0 -0
dnt/label/labeler.py
CHANGED
|
@@ -6,9 +6,9 @@ import pandas as pd
|
|
|
6
6
|
import os
|
|
7
7
|
|
|
8
8
|
class Labeler:
|
|
9
|
-
def __init__(self, method='opencv', frame_field=0,
|
|
10
|
-
label_fields=[1], color_field=1, zoom_factor=1, line_thickness=1,
|
|
11
|
-
color_bgr = (0, 255, 0), compress_message=False, nodraw_empty=True):
|
|
9
|
+
def __init__(self, method:str='opencv', frame_field:int=0,
|
|
10
|
+
label_fields:list[int]=[1], color_field:int=1, zoom_factor:int=1, line_thickness:int=1,
|
|
11
|
+
color_bgr = (0, 255, 0), compress_message:bool=False, nodraw_empty:bool=True):
|
|
12
12
|
|
|
13
13
|
self.method = method
|
|
14
14
|
self.frame_field = frame_field
|
|
@@ -20,8 +20,108 @@ class Labeler:
|
|
|
20
20
|
self.compress_message=compress_message
|
|
21
21
|
self.nodraw_empty = nodraw_empty
|
|
22
22
|
|
|
23
|
-
def
|
|
24
|
-
|
|
23
|
+
def draw2(self, input_video:str, output_video:str, draws:pd.DataFrame = None, draw_file:str = None,
|
|
24
|
+
start_frame:int=None, end_frame:int=None,
|
|
25
|
+
video_index:int=None, video_tot:int=None):
|
|
26
|
+
'''
|
|
27
|
+
General labeling function
|
|
28
|
+
Inputs:
|
|
29
|
+
draws: a DataFrame contains labeling information, if None, read label_file
|
|
30
|
+
label_file: a txt file with a header ['frame','type','coords','color','size','thick','desc']
|
|
31
|
+
input_video: raw video
|
|
32
|
+
output_video: labeled video
|
|
33
|
+
start_frame:
|
|
34
|
+
end_frame:
|
|
35
|
+
video_index: display video index in batch processing
|
|
36
|
+
video_tot: display total video number in batch processing
|
|
37
|
+
'''
|
|
38
|
+
if draws is not None:
|
|
39
|
+
data = draws
|
|
40
|
+
else:
|
|
41
|
+
data = pd.read_csv(draw_file, dtype={'frame':int, 'type':str, 'size':float, 'desc':str, 'thick':int},
|
|
42
|
+
converters={'coords': lambda x:list(eval(x)), 'color': lambda x:eval(x)})
|
|
43
|
+
|
|
44
|
+
cmap = plt.get_cmap('tab20b')
|
|
45
|
+
colors = [cmap(i)[:3] for i in np.linspace(0, 1, 20)]
|
|
46
|
+
|
|
47
|
+
cap = cv2.VideoCapture(input_video)
|
|
48
|
+
if not cap.isOpened():
|
|
49
|
+
raise IOError("Couldn't open webcam or video")
|
|
50
|
+
|
|
51
|
+
if start_frame is None:
|
|
52
|
+
start_frame = 0
|
|
53
|
+
if end_frame is None:
|
|
54
|
+
end_frame = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))-1
|
|
55
|
+
|
|
56
|
+
tot_frames = end_frame - start_frame + 1
|
|
57
|
+
fps = int(cap.get(cv2.CAP_PROP_FPS))
|
|
58
|
+
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
59
|
+
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
|
60
|
+
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
|
61
|
+
writer = cv2.VideoWriter(output_video, fourcc, fps, (width, height))
|
|
62
|
+
|
|
63
|
+
pbar = tqdm(total=tot_frames, unit=" frames")
|
|
64
|
+
if self.compress_message:
|
|
65
|
+
pbar.set_description_str("Labeling")
|
|
66
|
+
else:
|
|
67
|
+
if video_index and video_tot:
|
|
68
|
+
pbar.set_description_str("Labeling {} of {}".format(video_index, video_tot))
|
|
69
|
+
else:
|
|
70
|
+
pbar.set_description_str("Labeling {} ".format(input_video))
|
|
71
|
+
|
|
72
|
+
cap.set(cv2.CAP_PROP_POS_FRAMES, start_frame)
|
|
73
|
+
while cap.isOpened():
|
|
74
|
+
pos_frame = int(cap.get(cv2.CAP_PROP_POS_FRAMES))
|
|
75
|
+
ret, frame = cap.read()
|
|
76
|
+
if (not ret) or (pos_frame>end_frame):
|
|
77
|
+
break
|
|
78
|
+
|
|
79
|
+
elements = data.loc[data['frame']==pos_frame]
|
|
80
|
+
|
|
81
|
+
for index, element in elements.iterrows():
|
|
82
|
+
if element['type'] == 'txt':
|
|
83
|
+
label_txt = element['desc']
|
|
84
|
+
color = element['color']
|
|
85
|
+
size = element['size']
|
|
86
|
+
thick = element['thick']
|
|
87
|
+
cv2.putText(frame, label_txt, tuple(map(int, element['coords'][0])), 0, size, color, thick)
|
|
88
|
+
|
|
89
|
+
elif element['type'] == 'line':
|
|
90
|
+
coords = element['coords']
|
|
91
|
+
color = element['color']
|
|
92
|
+
thick = element['thick']
|
|
93
|
+
cv2.line(frame, tuple(map(int, coords[0])), tuple(map(int, coords[1])), color, thick)
|
|
94
|
+
|
|
95
|
+
elif element['type'] == 'box':
|
|
96
|
+
coords = element['coords']
|
|
97
|
+
color = element['color']
|
|
98
|
+
thick = element['thick']
|
|
99
|
+
cv2.rectangle(frame, tuple(map(int, coords[0])), tuple(map(int, coords[1])), color, thick)
|
|
100
|
+
|
|
101
|
+
elif element['type'] == 'bbox':
|
|
102
|
+
coords = element['coords']
|
|
103
|
+
color = element['color']
|
|
104
|
+
thick = element['thick']
|
|
105
|
+
label_txt = element['desc']
|
|
106
|
+
size = element['size']
|
|
107
|
+
|
|
108
|
+
cv2.rectangle(frame, tuple(map(int, coords[0])), tuple(map(int, coords[1])), color, thick)
|
|
109
|
+
cv2.putText(frame, str(label_txt), (int(coords[0][0]), int(coords[0][1]-int(10*size))),
|
|
110
|
+
cv2.FONT_HERSHEY_SIMPLEX, size, color, thick)
|
|
111
|
+
|
|
112
|
+
writer.write(frame)
|
|
113
|
+
key = cv2.waitKey(1) & 0xFF
|
|
114
|
+
if key == ord("q"):
|
|
115
|
+
break
|
|
116
|
+
|
|
117
|
+
pbar.update()
|
|
118
|
+
|
|
119
|
+
cv2.destroyAllWindows()
|
|
120
|
+
cap.release()
|
|
121
|
+
writer.release()
|
|
122
|
+
|
|
123
|
+
def draw(self, label_file:str, input_video:str, output_video:str, start_frame:int=None, end_frame:int=None,
|
|
124
|
+
video_index:int=None, video_tot:int=None):
|
|
25
125
|
tracks = pd.read_csv(label_file, header=None)
|
|
26
126
|
|
|
27
127
|
cmap = plt.get_cmap('tab20b')
|
|
@@ -103,7 +203,8 @@ class Labeler:
|
|
|
103
203
|
writer.release()
|
|
104
204
|
|
|
105
205
|
|
|
106
|
-
def draw_lines(self, lines, input_video, output_video, start_frame=None,
|
|
206
|
+
def draw_lines(self, lines:list[list[int]], input_video:str, output_video:str, start_frame:int=None,
|
|
207
|
+
end_frame:int=None, video_index:int=None, video_tot:int=None):
|
|
107
208
|
cap = cv2.VideoCapture(input_video)
|
|
108
209
|
if not cap.isOpened():
|
|
109
210
|
raise IOError("Couldn't open webcam or video")
|
|
@@ -150,7 +251,7 @@ class Labeler:
|
|
|
150
251
|
cap.release()
|
|
151
252
|
writer.release()
|
|
152
253
|
|
|
153
|
-
def clip(self, input_video, output_video, start_frame=None, end_frame=None):
|
|
254
|
+
def clip(self, input_video:str, output_video:str, start_frame:int=None, end_frame:int=None):
|
|
154
255
|
cap = cv2.VideoCapture(input_video)
|
|
155
256
|
if not cap.isOpened():
|
|
156
257
|
raise IOError("Couldn't open webcam or video")
|
|
@@ -191,7 +292,8 @@ class Labeler:
|
|
|
191
292
|
cap.release()
|
|
192
293
|
writer.release()
|
|
193
294
|
|
|
194
|
-
def draw_batch(self, label_files, input_videos, output_path,
|
|
295
|
+
def draw_batch(self, label_files:list[str], input_videos:list[str], output_path:str,
|
|
296
|
+
suffix:str='_track', is_overwrite:bool=False)->list[str]:
|
|
195
297
|
results = []
|
|
196
298
|
total_videos = len(label_files)
|
|
197
299
|
count=0
|
|
@@ -221,7 +323,8 @@ class Labeler:
|
|
|
221
323
|
|
|
222
324
|
return results
|
|
223
325
|
|
|
224
|
-
def draw_lines_batch(self, label_files, input_videos, output_path, suffix,
|
|
326
|
+
def draw_lines_batch(self, label_files:list[str], input_videos:list[str], output_path:str, suffix:str,
|
|
327
|
+
is_overwrite:bool=False, is_report:bool=True)->list[str]:
|
|
225
328
|
results = []
|
|
226
329
|
total_videos = len(label_files)
|
|
227
330
|
count=0
|
|
@@ -253,9 +356,12 @@ class Labeler:
|
|
|
253
356
|
|
|
254
357
|
return results
|
|
255
358
|
|
|
256
|
-
def draw_shapes(self, input_video, output_video,
|
|
257
|
-
|
|
258
|
-
|
|
359
|
+
def draw_shapes(self, input_video:str, output_video:str,
|
|
360
|
+
points:list[list[int]]=None,
|
|
361
|
+
lines:list[list[int]]=None,
|
|
362
|
+
polygons:list[np.array]=None,
|
|
363
|
+
point_color:tuple=None, line_color:tuple=None, polygon_color:tuple=None,
|
|
364
|
+
start_frame:int=None, end_frame:int=None, video_index:int=None, video_tot:int=None):
|
|
259
365
|
cap = cv2.VideoCapture(input_video)
|
|
260
366
|
if not cap.isOpened():
|
|
261
367
|
raise IOError("Couldn't open webcam or video")
|
|
@@ -319,8 +425,103 @@ class Labeler:
|
|
|
319
425
|
cap.release()
|
|
320
426
|
writer.release()
|
|
321
427
|
|
|
428
|
+
def draw_tracks(self, track_file:str,
|
|
429
|
+
input_video:str,
|
|
430
|
+
output_video:str,
|
|
431
|
+
tail:int=0,
|
|
432
|
+
start_frame:int=None, end_frame:int=None,
|
|
433
|
+
video_index:int=None, video_tot:int=None):
|
|
434
|
+
|
|
435
|
+
tracks = pd.read_csv(track_file, header=None)
|
|
436
|
+
|
|
437
|
+
cmap = plt.get_cmap('tab20b')
|
|
438
|
+
colors = [cmap(i)[:3] for i in np.linspace(0, 1, 20)]
|
|
439
|
+
|
|
440
|
+
cap = cv2.VideoCapture(input_video)
|
|
441
|
+
if not cap.isOpened():
|
|
442
|
+
raise IOError("Couldn't open webcam or video")
|
|
443
|
+
|
|
444
|
+
if start_frame is None:
|
|
445
|
+
start_frame = 0
|
|
446
|
+
if end_frame is None:
|
|
447
|
+
end_frame = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))-1
|
|
448
|
+
|
|
449
|
+
tot_frames = end_frame - start_frame + 1
|
|
450
|
+
fps = int(cap.get(cv2.CAP_PROP_FPS))
|
|
451
|
+
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
452
|
+
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
|
453
|
+
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
|
454
|
+
writer = cv2.VideoWriter(output_video, fourcc, fps, (width, height))
|
|
455
|
+
|
|
456
|
+
pbar = tqdm(total=tot_frames, unit=" frames")
|
|
457
|
+
if self.compress_message:
|
|
458
|
+
pbar.set_description_str("Labeling")
|
|
459
|
+
else:
|
|
460
|
+
if video_index and video_tot:
|
|
461
|
+
pbar.set_description_str("Labeling {} of {}".format(video_index, video_tot))
|
|
462
|
+
else:
|
|
463
|
+
pbar.set_description_str("Labeling {} ".format(input_video))
|
|
464
|
+
|
|
465
|
+
cap.set(cv2.CAP_PROP_POS_FRAMES, start_frame)
|
|
466
|
+
while cap.isOpened():
|
|
467
|
+
pos_frame = int(cap.get(cv2.CAP_PROP_POS_FRAMES))
|
|
468
|
+
ret, frame = cap.read()
|
|
469
|
+
if (not ret) or (pos_frame>end_frame):
|
|
470
|
+
break
|
|
471
|
+
|
|
472
|
+
boxes = tracks[tracks.iloc[:,self.frame_field]==pos_frame].values.tolist()
|
|
473
|
+
for box in boxes:
|
|
474
|
+
track_id = box[1]
|
|
475
|
+
|
|
476
|
+
x1 = int(box[2])
|
|
477
|
+
y1 = int(box[3])
|
|
478
|
+
x2 = x1 + int(box[4])
|
|
479
|
+
y2 = y1 + int(box[5])
|
|
480
|
+
|
|
481
|
+
color = colors[int(box[self.color_field]) % len(colors)]
|
|
482
|
+
color = [i * 255 for i in color]
|
|
483
|
+
|
|
484
|
+
label_txt = ''
|
|
485
|
+
for field in self.label_fields:
|
|
486
|
+
if (str(box[field]).strip() == '-1'):
|
|
487
|
+
if self.nodraw_empty:
|
|
488
|
+
label_txt += ''
|
|
489
|
+
else:
|
|
490
|
+
label_txt += str(box[field]) + ' '
|
|
491
|
+
else:
|
|
492
|
+
label_txt += str(box[field]) + ' '
|
|
493
|
+
|
|
494
|
+
label_txt = label_txt.strip()
|
|
495
|
+
|
|
496
|
+
if tail>0:
|
|
497
|
+
frames = [*range(pos_frame-tail, pos_frame)]
|
|
498
|
+
pre_boxes = tracks.loc[(tracks[self.frame_field].isin(frames)) & (tracks[1]==track_id)].values.tolist()
|
|
499
|
+
if len(pre_boxes)>0:
|
|
500
|
+
for pre_box in pre_boxes:
|
|
501
|
+
xc = int(pre_box[2]) + int(pre_box[4]/2)
|
|
502
|
+
yc = int(pre_box[3]) + int(pre_box[5]/2)
|
|
503
|
+
cv2.circle(frame, (xc, yc), radius=0, color=color, thickness=self.line_thickness)
|
|
504
|
+
|
|
505
|
+
if label_txt:
|
|
506
|
+
cv2.rectangle(frame, (x1, y1), (x2, y2), color, self.line_thickness)
|
|
507
|
+
cv2.rectangle(frame, (x1, int(y1-30*self.zoom_factor)), (x1+len(label_txt)*int(17*self.zoom_factor), y1),
|
|
508
|
+
color, -1)
|
|
509
|
+
cv2.putText(frame,str(label_txt),(int(x1), int(y1-int(10*self.zoom_factor))),
|
|
510
|
+
0, 0.75*self.zoom_factor, (255,255,255), 1)
|
|
511
|
+
|
|
512
|
+
writer.write(frame)
|
|
513
|
+
key = cv2.waitKey(1) & 0xFF
|
|
514
|
+
if key == ord("q"):
|
|
515
|
+
break
|
|
516
|
+
|
|
517
|
+
pbar.update()
|
|
518
|
+
|
|
519
|
+
cv2.destroyAllWindows()
|
|
520
|
+
cap.release()
|
|
521
|
+
writer.release()
|
|
522
|
+
|
|
322
523
|
@staticmethod
|
|
323
|
-
def export_frames(input_video, frames, output_path):
|
|
524
|
+
def export_frames(input_video:str, frames:list[int], output_path:str):
|
|
324
525
|
|
|
325
526
|
cap = cv2.VideoCapture(input_video)
|
|
326
527
|
if not cap.isOpened():
|
|
@@ -347,7 +548,7 @@ class Labeler:
|
|
|
347
548
|
print("Writing frames to {}".format(output_path))
|
|
348
549
|
|
|
349
550
|
@staticmethod
|
|
350
|
-
def time2frame(input_video, time):
|
|
551
|
+
def time2frame(input_video:str, time:float):
|
|
351
552
|
cap = cv2.VideoCapture(input_video)
|
|
352
553
|
if not cap.isOpened():
|
|
353
554
|
raise IOError("Couldn't open webcam or video")
|