dnt 0.2.4__py3-none-any.whl → 0.3.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dnt/__init__.py +3 -2
- dnt/analysis/__init__.py +3 -2
- dnt/analysis/count.py +54 -37
- dnt/analysis/interaction2.py +518 -0
- dnt/analysis/stop.py +22 -17
- dnt/analysis/stop2.py +289 -0
- dnt/analysis/stop3.py +758 -0
- dnt/detect/signal/detector.py +326 -0
- dnt/detect/timestamp.py +105 -0
- dnt/detect/yolov8/detector.py +179 -36
- dnt/detect/yolov8/segmentor.py +60 -2
- dnt/engine/__init__.py +8 -0
- dnt/engine/bbox_interp.py +83 -0
- dnt/engine/bbox_iou.py +20 -0
- dnt/engine/cluster.py +31 -0
- dnt/engine/iob.py +66 -0
- dnt/filter/filter.py +333 -2
- dnt/label/labeler.py +4 -4
- dnt/label/labeler2.py +631 -0
- dnt/shared/__init__.py +2 -1
- dnt/shared/data/coco.names +0 -0
- dnt/shared/data/openimages.names +0 -0
- dnt/shared/data/voc.names +0 -0
- dnt/shared/download.py +12 -0
- dnt/shared/synhcro.py +150 -0
- dnt/shared/util.py +17 -4
- dnt/third_party/fast-reid/__init__.py +1 -0
- dnt/third_party/fast-reid/configs/Base-AGW.yml +19 -0
- dnt/third_party/fast-reid/configs/Base-MGN.yml +12 -0
- dnt/third_party/fast-reid/configs/Base-SBS.yml +63 -0
- dnt/third_party/fast-reid/configs/Base-bagtricks.yml +76 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/DukeMTMC/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MOT20/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R101-ibn.yml +13 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/bagtricks_S50.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/MSMT17/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/AGW_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/bagtricks_vit.yml +88 -0
- dnt/third_party/fast-reid/configs/Market1501/mgn_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R101-ibn.yml +12 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50-ibn.yml +11 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_R50.yml +7 -0
- dnt/third_party/fast-reid/configs/Market1501/sbs_S50.yml +11 -0
- dnt/third_party/fast-reid/configs/VERIWild/bagtricks_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VeRi/sbs_R50-ibn.yml +35 -0
- dnt/third_party/fast-reid/configs/VehicleID/bagtricks_R50-ibn.yml +36 -0
- dnt/third_party/fast-reid/configs/__init__.py +0 -0
- dnt/third_party/fast-reid/fast_reid_interfece.py +175 -0
- dnt/third_party/fast-reid/fastreid/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/config/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/config/config.py +319 -0
- dnt/third_party/fast-reid/fastreid/config/defaults.py +329 -0
- dnt/third_party/fast-reid/fastreid/data/__init__.py +17 -0
- dnt/third_party/fast-reid/fastreid/data/build.py +194 -0
- dnt/third_party/fast-reid/fastreid/data/common.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/data_utils.py +202 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/AirportALERT.py +50 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/__init__.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/bases.py +183 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/caviara.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk03.py +274 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/cuhk_sysu.py +58 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/dukemtmcreid.py +70 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/grid.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/iLIDS.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/lpw.py +49 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/market1501.py +89 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/msmt17.py +114 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pes3d.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/pku.py +44 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prai.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/prid.py +41 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/saivt.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sensereid.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/shinpuhkan.py +48 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/sysu_mm.py +47 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/thermalworld.py +43 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/vehicleid.py +126 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veri.py +69 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/veriwild.py +140 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/viper.py +45 -0
- dnt/third_party/fast-reid/fastreid/data/datasets/wildtracker.py +59 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/data_sampler.py +85 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/imbalance_sampler.py +67 -0
- dnt/third_party/fast-reid/fastreid/data/samplers/triplet_sampler.py +260 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/autoaugment.py +806 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/build.py +100 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/functional.py +180 -0
- dnt/third_party/fast-reid/fastreid/data/transforms/transforms.py +161 -0
- dnt/third_party/fast-reid/fastreid/engine/__init__.py +15 -0
- dnt/third_party/fast-reid/fastreid/engine/defaults.py +490 -0
- dnt/third_party/fast-reid/fastreid/engine/hooks.py +534 -0
- dnt/third_party/fast-reid/fastreid/engine/launch.py +103 -0
- dnt/third_party/fast-reid/fastreid/engine/train_loop.py +357 -0
- dnt/third_party/fast-reid/fastreid/evaluation/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/evaluation/clas_evaluator.py +81 -0
- dnt/third_party/fast-reid/fastreid/evaluation/evaluator.py +176 -0
- dnt/third_party/fast-reid/fastreid/evaluation/query_expansion.py +46 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank.py +200 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/__init__.py +20 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/setup.py +32 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rank_cylib/test_cython.py +106 -0
- dnt/third_party/fast-reid/fastreid/evaluation/reid_evaluation.py +143 -0
- dnt/third_party/fast-reid/fastreid/evaluation/rerank.py +73 -0
- dnt/third_party/fast-reid/fastreid/evaluation/roc.py +90 -0
- dnt/third_party/fast-reid/fastreid/evaluation/testing.py +88 -0
- dnt/third_party/fast-reid/fastreid/layers/__init__.py +19 -0
- dnt/third_party/fast-reid/fastreid/layers/activation.py +59 -0
- dnt/third_party/fast-reid/fastreid/layers/any_softmax.py +80 -0
- dnt/third_party/fast-reid/fastreid/layers/batch_norm.py +205 -0
- dnt/third_party/fast-reid/fastreid/layers/context_block.py +113 -0
- dnt/third_party/fast-reid/fastreid/layers/drop.py +161 -0
- dnt/third_party/fast-reid/fastreid/layers/frn.py +199 -0
- dnt/third_party/fast-reid/fastreid/layers/gather_layer.py +30 -0
- dnt/third_party/fast-reid/fastreid/layers/helpers.py +31 -0
- dnt/third_party/fast-reid/fastreid/layers/non_local.py +54 -0
- dnt/third_party/fast-reid/fastreid/layers/pooling.py +124 -0
- dnt/third_party/fast-reid/fastreid/layers/se_layer.py +25 -0
- dnt/third_party/fast-reid/fastreid/layers/splat.py +109 -0
- dnt/third_party/fast-reid/fastreid/layers/weight_init.py +122 -0
- dnt/third_party/fast-reid/fastreid/modeling/__init__.py +23 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/__init__.py +18 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/build.py +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenet.py +195 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/mobilenetv3.py +283 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/osnet.py +525 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/__init__.py +4 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/config.py +396 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B0_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B1_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B2_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B3_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B4_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet/EN-B5_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/effnet.py +281 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnet.py +596 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-1.6GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-12GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-16GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-3.2GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-32GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-4.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-400MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-6.4GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-600MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-8.0GF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnetx/RegNetX-800MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-1.6GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-12GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-16GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-200MF_dds_8gpu.yaml +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-3.2GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-32GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-4.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-400MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-6.4GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-600MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-8.0GF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/regnet/regnety/RegNetY-800MF_dds_8gpu.yaml +27 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/repvgg.py +309 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnest.py +365 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnet.py +364 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/resnext.py +335 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/shufflenet.py +203 -0
- dnt/third_party/fast-reid/fastreid/modeling/backbones/vision_transformer.py +399 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/__init__.py +11 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/build.py +25 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/clas_head.py +36 -0
- dnt/third_party/fast-reid/fastreid/modeling/heads/embedding_head.py +151 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/__init__.py +12 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/circle_loss.py +71 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/cross_entroy_loss.py +54 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/focal_loss.py +92 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/triplet_loss.py +113 -0
- dnt/third_party/fast-reid/fastreid/modeling/losses/utils.py +48 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/__init__.py +14 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/baseline.py +188 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/build.py +26 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/distiller.py +140 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/mgn.py +394 -0
- dnt/third_party/fast-reid/fastreid/modeling/meta_arch/moco.py +126 -0
- dnt/third_party/fast-reid/fastreid/solver/__init__.py +8 -0
- dnt/third_party/fast-reid/fastreid/solver/build.py +348 -0
- dnt/third_party/fast-reid/fastreid/solver/lr_scheduler.py +66 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/__init__.py +10 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/lamb.py +123 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/radam.py +149 -0
- dnt/third_party/fast-reid/fastreid/solver/optim/swa.py +246 -0
- dnt/third_party/fast-reid/fastreid/utils/__init__.py +6 -0
- dnt/third_party/fast-reid/fastreid/utils/checkpoint.py +503 -0
- dnt/third_party/fast-reid/fastreid/utils/collect_env.py +158 -0
- dnt/third_party/fast-reid/fastreid/utils/comm.py +255 -0
- dnt/third_party/fast-reid/fastreid/utils/compute_dist.py +200 -0
- dnt/third_party/fast-reid/fastreid/utils/env.py +119 -0
- dnt/third_party/fast-reid/fastreid/utils/events.py +461 -0
- dnt/third_party/fast-reid/fastreid/utils/faiss_utils.py +127 -0
- dnt/third_party/fast-reid/fastreid/utils/file_io.py +520 -0
- dnt/third_party/fast-reid/fastreid/utils/history_buffer.py +71 -0
- dnt/third_party/fast-reid/fastreid/utils/logger.py +211 -0
- dnt/third_party/fast-reid/fastreid/utils/params.py +103 -0
- dnt/third_party/fast-reid/fastreid/utils/precision_bn.py +94 -0
- dnt/third_party/fast-reid/fastreid/utils/registry.py +66 -0
- dnt/third_party/fast-reid/fastreid/utils/summary.py +120 -0
- dnt/third_party/fast-reid/fastreid/utils/timer.py +68 -0
- dnt/third_party/fast-reid/fastreid/utils/visualizer.py +278 -0
- dnt/track/__init__.py +2 -0
- dnt/track/botsort/__init__.py +4 -0
- dnt/track/botsort/bot_tracker/__init__.py +3 -0
- dnt/track/botsort/bot_tracker/basetrack.py +60 -0
- dnt/track/botsort/bot_tracker/bot_sort.py +473 -0
- dnt/track/botsort/bot_tracker/gmc.py +316 -0
- dnt/track/botsort/bot_tracker/kalman_filter.py +269 -0
- dnt/track/botsort/bot_tracker/matching.py +194 -0
- dnt/track/botsort/bot_tracker/mc_bot_sort.py +505 -0
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/evaluation.py +14 -4
- dnt/track/{dsort/utils → botsort/bot_tracker/tracking_utils}/io.py +19 -36
- dnt/track/botsort/bot_tracker/tracking_utils/timer.py +37 -0
- dnt/track/botsort/inference.py +96 -0
- dnt/track/config.py +120 -0
- dnt/track/dsort/configs/bagtricks_R50.yml +7 -0
- dnt/track/dsort/configs/deep_sort.yaml +0 -0
- dnt/track/dsort/configs/fastreid.yaml +1 -1
- dnt/track/dsort/deep_sort/deep/checkpoint/ckpt.t7 +0 -0
- dnt/track/dsort/deep_sort/deep/feature_extractor.py +87 -8
- dnt/track/dsort/deep_sort/deep_sort.py +31 -20
- dnt/track/dsort/deep_sort/sort/detection.py +2 -1
- dnt/track/dsort/deep_sort/sort/iou_matching.py +0 -2
- dnt/track/dsort/deep_sort/sort/linear_assignment.py +0 -3
- dnt/track/dsort/deep_sort/sort/nn_matching.py +5 -5
- dnt/track/dsort/deep_sort/sort/preprocessing.py +1 -2
- dnt/track/dsort/deep_sort/sort/track.py +2 -1
- dnt/track/dsort/deep_sort/sort/tracker.py +1 -1
- dnt/track/dsort/dsort.py +43 -33
- dnt/track/re_class.py +117 -0
- dnt/track/sort/sort.py +9 -6
- dnt/track/tracker.py +213 -32
- dnt-0.3.1.8.dist-info/METADATA +117 -0
- dnt-0.3.1.8.dist-info/RECORD +315 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info}/WHEEL +1 -1
- dnt/analysis/yield.py +0 -9
- dnt/track/dsort/deep_sort/deep/evaluate.py +0 -15
- dnt/track/dsort/deep_sort/deep/original_model.py +0 -106
- dnt/track/dsort/deep_sort/deep/test.py +0 -77
- dnt/track/dsort/deep_sort/deep/train.py +0 -189
- dnt/track/dsort/utils/asserts.py +0 -13
- dnt/track/dsort/utils/draw.py +0 -36
- dnt/track/dsort/utils/json_logger.py +0 -383
- dnt/track/dsort/utils/log.py +0 -17
- dnt/track/dsort/utils/parser.py +0 -35
- dnt/track/dsort/utils/tools.py +0 -39
- dnt-0.2.4.dist-info/METADATA +0 -35
- dnt-0.2.4.dist-info/RECORD +0 -64
- /dnt/{track/dsort/utils → third_party/fast-reid/checkpoint}/__init__.py +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info/licenses}/LICENSE +0 -0
- {dnt-0.2.4.dist-info → dnt-0.3.1.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: liaoxingyu
|
|
4
|
+
@contact: liaoxingyu2@jd.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import os.path as osp
|
|
9
|
+
|
|
10
|
+
from fastreid.data.datasets import DATASET_REGISTRY
|
|
11
|
+
from fastreid.utils.file_io import PathManager
|
|
12
|
+
from .bases import ImageDataset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@DATASET_REGISTRY.register()
|
|
16
|
+
class CUHK03(ImageDataset):
|
|
17
|
+
"""CUHK03.
|
|
18
|
+
|
|
19
|
+
Reference:
|
|
20
|
+
Li et al. DeepReID: Deep Filter Pairing Neural Network for Person Re-identification. CVPR 2014.
|
|
21
|
+
|
|
22
|
+
URL: `<http://www.ee.cuhk.edu.hk/~xgwang/CUHK_identification.html#!>`_
|
|
23
|
+
|
|
24
|
+
Dataset statistics:
|
|
25
|
+
- identities: 1360.
|
|
26
|
+
- images: 13164.
|
|
27
|
+
- cameras: 6.
|
|
28
|
+
- splits: 20 (classic).
|
|
29
|
+
"""
|
|
30
|
+
dataset_dir = 'cuhk03'
|
|
31
|
+
dataset_url = None
|
|
32
|
+
dataset_name = "cuhk03"
|
|
33
|
+
|
|
34
|
+
def __init__(self, root='datasets', split_id=0, cuhk03_labeled=True, cuhk03_classic_split=False, **kwargs):
|
|
35
|
+
self.root = root
|
|
36
|
+
self.dataset_dir = osp.join(self.root, self.dataset_dir)
|
|
37
|
+
|
|
38
|
+
self.data_dir = osp.join(self.dataset_dir, 'cuhk03_release')
|
|
39
|
+
self.raw_mat_path = osp.join(self.data_dir, 'cuhk-03.mat')
|
|
40
|
+
|
|
41
|
+
self.imgs_detected_dir = osp.join(self.dataset_dir, 'images_detected')
|
|
42
|
+
self.imgs_labeled_dir = osp.join(self.dataset_dir, 'images_labeled')
|
|
43
|
+
|
|
44
|
+
self.split_classic_det_json_path = osp.join(self.dataset_dir, 'splits_classic_detected.json')
|
|
45
|
+
self.split_classic_lab_json_path = osp.join(self.dataset_dir, 'splits_classic_labeled.json')
|
|
46
|
+
|
|
47
|
+
self.split_new_det_json_path = osp.join(self.dataset_dir, 'splits_new_detected.json')
|
|
48
|
+
self.split_new_lab_json_path = osp.join(self.dataset_dir, 'splits_new_labeled.json')
|
|
49
|
+
|
|
50
|
+
self.split_new_det_mat_path = osp.join(self.dataset_dir, 'cuhk03_new_protocol_config_detected.mat')
|
|
51
|
+
self.split_new_lab_mat_path = osp.join(self.dataset_dir, 'cuhk03_new_protocol_config_labeled.mat')
|
|
52
|
+
|
|
53
|
+
required_files = [
|
|
54
|
+
self.dataset_dir,
|
|
55
|
+
self.data_dir,
|
|
56
|
+
self.raw_mat_path,
|
|
57
|
+
self.split_new_det_mat_path,
|
|
58
|
+
self.split_new_lab_mat_path
|
|
59
|
+
]
|
|
60
|
+
self.check_before_run(required_files)
|
|
61
|
+
|
|
62
|
+
self.preprocess_split()
|
|
63
|
+
|
|
64
|
+
if cuhk03_labeled:
|
|
65
|
+
split_path = self.split_classic_lab_json_path if cuhk03_classic_split else self.split_new_lab_json_path
|
|
66
|
+
else:
|
|
67
|
+
split_path = self.split_classic_det_json_path if cuhk03_classic_split else self.split_new_det_json_path
|
|
68
|
+
|
|
69
|
+
with PathManager.open(split_path) as f:
|
|
70
|
+
splits = json.load(f)
|
|
71
|
+
assert split_id < len(splits), 'Condition split_id ({}) < len(splits) ({}) is false'.format(split_id,
|
|
72
|
+
len(splits))
|
|
73
|
+
split = splits[split_id]
|
|
74
|
+
|
|
75
|
+
train = split['train']
|
|
76
|
+
tmp_train = []
|
|
77
|
+
for img_path, pid, camid in train:
|
|
78
|
+
new_pid = self.dataset_name + "_" + str(pid)
|
|
79
|
+
new_camid = self.dataset_name + "_" + str(camid)
|
|
80
|
+
tmp_train.append((img_path, new_pid, new_camid))
|
|
81
|
+
train = tmp_train
|
|
82
|
+
del tmp_train
|
|
83
|
+
query = split['query']
|
|
84
|
+
gallery = split['gallery']
|
|
85
|
+
|
|
86
|
+
super(CUHK03, self).__init__(train, query, gallery, **kwargs)
|
|
87
|
+
|
|
88
|
+
def preprocess_split(self):
|
|
89
|
+
# This function is a bit complex and ugly, what it does is
|
|
90
|
+
# 1. extract data from cuhk-03.mat and save as png images
|
|
91
|
+
# 2. create 20 classic splits (Li et al. CVPR'14)
|
|
92
|
+
# 3. create new split (Zhong et al. CVPR'17)
|
|
93
|
+
if osp.exists(self.imgs_labeled_dir) \
|
|
94
|
+
and osp.exists(self.imgs_detected_dir) \
|
|
95
|
+
and osp.exists(self.split_classic_det_json_path) \
|
|
96
|
+
and osp.exists(self.split_classic_lab_json_path) \
|
|
97
|
+
and osp.exists(self.split_new_det_json_path) \
|
|
98
|
+
and osp.exists(self.split_new_lab_json_path):
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
import h5py
|
|
102
|
+
from imageio import imwrite
|
|
103
|
+
from scipy import io
|
|
104
|
+
|
|
105
|
+
PathManager.mkdirs(self.imgs_detected_dir)
|
|
106
|
+
PathManager.mkdirs(self.imgs_labeled_dir)
|
|
107
|
+
|
|
108
|
+
print('Extract image data from "{}" and save as png'.format(self.raw_mat_path))
|
|
109
|
+
mat = h5py.File(self.raw_mat_path, 'r')
|
|
110
|
+
|
|
111
|
+
def _deref(ref):
|
|
112
|
+
return mat[ref][:].T
|
|
113
|
+
|
|
114
|
+
def _process_images(img_refs, campid, pid, save_dir):
|
|
115
|
+
img_paths = [] # Note: some persons only have images for one view
|
|
116
|
+
for imgid, img_ref in enumerate(img_refs):
|
|
117
|
+
img = _deref(img_ref)
|
|
118
|
+
if img.size == 0 or img.ndim < 3:
|
|
119
|
+
continue # skip empty cell
|
|
120
|
+
# images are saved with the following format, index-1 (ensure uniqueness)
|
|
121
|
+
# campid: index of camera pair (1-5)
|
|
122
|
+
# pid: index of person in 'campid'-th camera pair
|
|
123
|
+
# viewid: index of view, {1, 2}
|
|
124
|
+
# imgid: index of image, (1-10)
|
|
125
|
+
viewid = 1 if imgid < 5 else 2
|
|
126
|
+
img_name = '{:01d}_{:03d}_{:01d}_{:02d}.png'.format(campid + 1, pid + 1, viewid, imgid + 1)
|
|
127
|
+
img_path = osp.join(save_dir, img_name)
|
|
128
|
+
if not osp.isfile(img_path):
|
|
129
|
+
imwrite(img_path, img)
|
|
130
|
+
img_paths.append(img_path)
|
|
131
|
+
return img_paths
|
|
132
|
+
|
|
133
|
+
def _extract_img(image_type):
|
|
134
|
+
print('Processing {} images ...'.format(image_type))
|
|
135
|
+
meta_data = []
|
|
136
|
+
imgs_dir = self.imgs_detected_dir if image_type == 'detected' else self.imgs_labeled_dir
|
|
137
|
+
for campid, camp_ref in enumerate(mat[image_type][0]):
|
|
138
|
+
camp = _deref(camp_ref)
|
|
139
|
+
num_pids = camp.shape[0]
|
|
140
|
+
for pid in range(num_pids):
|
|
141
|
+
img_paths = _process_images(camp[pid, :], campid, pid, imgs_dir)
|
|
142
|
+
assert len(img_paths) > 0, 'campid{}-pid{} has no images'.format(campid, pid)
|
|
143
|
+
meta_data.append((campid + 1, pid + 1, img_paths))
|
|
144
|
+
print('- done camera pair {} with {} identities'.format(campid + 1, num_pids))
|
|
145
|
+
return meta_data
|
|
146
|
+
|
|
147
|
+
meta_detected = _extract_img('detected')
|
|
148
|
+
meta_labeled = _extract_img('labeled')
|
|
149
|
+
|
|
150
|
+
def _extract_classic_split(meta_data, test_split):
|
|
151
|
+
train, test = [], []
|
|
152
|
+
num_train_pids, num_test_pids = 0, 0
|
|
153
|
+
num_train_imgs, num_test_imgs = 0, 0
|
|
154
|
+
for i, (campid, pid, img_paths) in enumerate(meta_data):
|
|
155
|
+
|
|
156
|
+
if [campid, pid] in test_split:
|
|
157
|
+
for img_path in img_paths:
|
|
158
|
+
camid = int(osp.basename(img_path).split('_')[2]) - 1 # make it 0-based
|
|
159
|
+
test.append((img_path, num_test_pids, camid))
|
|
160
|
+
num_test_pids += 1
|
|
161
|
+
num_test_imgs += len(img_paths)
|
|
162
|
+
else:
|
|
163
|
+
for img_path in img_paths:
|
|
164
|
+
camid = int(osp.basename(img_path).split('_')[2]) - 1 # make it 0-based
|
|
165
|
+
train.append((img_path, num_train_pids, camid))
|
|
166
|
+
num_train_pids += 1
|
|
167
|
+
num_train_imgs += len(img_paths)
|
|
168
|
+
return train, num_train_pids, num_train_imgs, test, num_test_pids, num_test_imgs
|
|
169
|
+
|
|
170
|
+
print('Creating classic splits (# = 20) ...')
|
|
171
|
+
splits_classic_det, splits_classic_lab = [], []
|
|
172
|
+
for split_ref in mat['testsets'][0]:
|
|
173
|
+
test_split = _deref(split_ref).tolist()
|
|
174
|
+
|
|
175
|
+
# create split for detected images
|
|
176
|
+
train, num_train_pids, num_train_imgs, test, num_test_pids, num_test_imgs = \
|
|
177
|
+
_extract_classic_split(meta_detected, test_split)
|
|
178
|
+
splits_classic_det.append({
|
|
179
|
+
'train': train,
|
|
180
|
+
'query': test,
|
|
181
|
+
'gallery': test,
|
|
182
|
+
'num_train_pids': num_train_pids,
|
|
183
|
+
'num_train_imgs': num_train_imgs,
|
|
184
|
+
'num_query_pids': num_test_pids,
|
|
185
|
+
'num_query_imgs': num_test_imgs,
|
|
186
|
+
'num_gallery_pids': num_test_pids,
|
|
187
|
+
'num_gallery_imgs': num_test_imgs
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
# create split for labeled images
|
|
191
|
+
train, num_train_pids, num_train_imgs, test, num_test_pids, num_test_imgs = \
|
|
192
|
+
_extract_classic_split(meta_labeled, test_split)
|
|
193
|
+
splits_classic_lab.append({
|
|
194
|
+
'train': train,
|
|
195
|
+
'query': test,
|
|
196
|
+
'gallery': test,
|
|
197
|
+
'num_train_pids': num_train_pids,
|
|
198
|
+
'num_train_imgs': num_train_imgs,
|
|
199
|
+
'num_query_pids': num_test_pids,
|
|
200
|
+
'num_query_imgs': num_test_imgs,
|
|
201
|
+
'num_gallery_pids': num_test_pids,
|
|
202
|
+
'num_gallery_imgs': num_test_imgs
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
with PathManager.open(self.split_classic_det_json_path, 'w') as f:
|
|
206
|
+
json.dump(splits_classic_det, f, indent=4, separators=(',', ': '))
|
|
207
|
+
with PathManager.open(self.split_classic_lab_json_path, 'w') as f:
|
|
208
|
+
json.dump(splits_classic_lab, f, indent=4, separators=(',', ': '))
|
|
209
|
+
|
|
210
|
+
def _extract_set(filelist, pids, pid2label, idxs, img_dir, relabel):
|
|
211
|
+
tmp_set = []
|
|
212
|
+
unique_pids = set()
|
|
213
|
+
for idx in idxs:
|
|
214
|
+
img_name = filelist[idx][0]
|
|
215
|
+
camid = int(img_name.split('_')[2]) - 1 # make it 0-based
|
|
216
|
+
pid = pids[idx]
|
|
217
|
+
if relabel:
|
|
218
|
+
pid = pid2label[pid]
|
|
219
|
+
img_path = osp.join(img_dir, img_name)
|
|
220
|
+
tmp_set.append((img_path, int(pid), camid))
|
|
221
|
+
unique_pids.add(pid)
|
|
222
|
+
return tmp_set, len(unique_pids), len(idxs)
|
|
223
|
+
|
|
224
|
+
def _extract_new_split(split_dict, img_dir):
|
|
225
|
+
train_idxs = split_dict['train_idx'].flatten() - 1 # index-0
|
|
226
|
+
pids = split_dict['labels'].flatten()
|
|
227
|
+
train_pids = set(pids[train_idxs])
|
|
228
|
+
pid2label = {pid: label for label, pid in enumerate(train_pids)}
|
|
229
|
+
query_idxs = split_dict['query_idx'].flatten() - 1
|
|
230
|
+
gallery_idxs = split_dict['gallery_idx'].flatten() - 1
|
|
231
|
+
filelist = split_dict['filelist'].flatten()
|
|
232
|
+
train_info = _extract_set(filelist, pids, pid2label, train_idxs, img_dir, relabel=True)
|
|
233
|
+
query_info = _extract_set(filelist, pids, pid2label, query_idxs, img_dir, relabel=False)
|
|
234
|
+
gallery_info = _extract_set(filelist, pids, pid2label, gallery_idxs, img_dir, relabel=False)
|
|
235
|
+
return train_info, query_info, gallery_info
|
|
236
|
+
|
|
237
|
+
print('Creating new split for detected images (767/700) ...')
|
|
238
|
+
train_info, query_info, gallery_info = _extract_new_split(
|
|
239
|
+
io.loadmat(self.split_new_det_mat_path),
|
|
240
|
+
self.imgs_detected_dir
|
|
241
|
+
)
|
|
242
|
+
split = [{
|
|
243
|
+
'train': train_info[0],
|
|
244
|
+
'query': query_info[0],
|
|
245
|
+
'gallery': gallery_info[0],
|
|
246
|
+
'num_train_pids': train_info[1],
|
|
247
|
+
'num_train_imgs': train_info[2],
|
|
248
|
+
'num_query_pids': query_info[1],
|
|
249
|
+
'num_query_imgs': query_info[2],
|
|
250
|
+
'num_gallery_pids': gallery_info[1],
|
|
251
|
+
'num_gallery_imgs': gallery_info[2]
|
|
252
|
+
}]
|
|
253
|
+
|
|
254
|
+
with PathManager.open(self.split_new_det_json_path, 'w') as f:
|
|
255
|
+
json.dump(split, f, indent=4, separators=(',', ': '))
|
|
256
|
+
|
|
257
|
+
print('Creating new split for labeled images (767/700) ...')
|
|
258
|
+
train_info, query_info, gallery_info = _extract_new_split(
|
|
259
|
+
io.loadmat(self.split_new_lab_mat_path),
|
|
260
|
+
self.imgs_labeled_dir
|
|
261
|
+
)
|
|
262
|
+
split = [{
|
|
263
|
+
'train': train_info[0],
|
|
264
|
+
'query': query_info[0],
|
|
265
|
+
'gallery': gallery_info[0],
|
|
266
|
+
'num_train_pids': train_info[1],
|
|
267
|
+
'num_train_imgs': train_info[2],
|
|
268
|
+
'num_query_pids': query_info[1],
|
|
269
|
+
'num_query_imgs': query_info[2],
|
|
270
|
+
'num_gallery_pids': gallery_info[1],
|
|
271
|
+
'num_gallery_imgs': gallery_info[2]
|
|
272
|
+
}]
|
|
273
|
+
with PathManager.open(self.split_new_lab_json_path, 'w') as f:
|
|
274
|
+
json.dump(split, f, indent=4, separators=(',', ': '))
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: xingyu liao
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import glob
|
|
8
|
+
import os.path as osp
|
|
9
|
+
import re
|
|
10
|
+
import warnings
|
|
11
|
+
|
|
12
|
+
from .bases import ImageDataset
|
|
13
|
+
from ..datasets import DATASET_REGISTRY
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@DATASET_REGISTRY.register()
|
|
17
|
+
class cuhkSYSU(ImageDataset):
|
|
18
|
+
"""CUHK SYSU datasets.
|
|
19
|
+
|
|
20
|
+
The dataset is collected from two sources: street snap and movie.
|
|
21
|
+
In street snap, 12,490 images and 6,057 query persons were collected
|
|
22
|
+
with movable cameras across hundreds of scenes while 5,694 images and
|
|
23
|
+
2,375 query persons were selected from movies and TV dramas.
|
|
24
|
+
|
|
25
|
+
Dataset statistics:
|
|
26
|
+
- identities: xxx.
|
|
27
|
+
- images: 12936 (train).
|
|
28
|
+
"""
|
|
29
|
+
dataset_dir = 'cuhk_sysu'
|
|
30
|
+
dataset_name = "cuhksysu"
|
|
31
|
+
|
|
32
|
+
def __init__(self, root='datasets', **kwargs):
|
|
33
|
+
self.root = root
|
|
34
|
+
self.dataset_dir = osp.join(self.root, self.dataset_dir)
|
|
35
|
+
|
|
36
|
+
self.data_dir = osp.join(self.dataset_dir, "cropped_images")
|
|
37
|
+
|
|
38
|
+
required_files = [self.data_dir]
|
|
39
|
+
self.check_before_run(required_files)
|
|
40
|
+
|
|
41
|
+
train = self.process_dir(self.data_dir)
|
|
42
|
+
query = []
|
|
43
|
+
gallery = []
|
|
44
|
+
|
|
45
|
+
super(cuhkSYSU, self).__init__(train, query, gallery, **kwargs)
|
|
46
|
+
|
|
47
|
+
def process_dir(self, dir_path):
|
|
48
|
+
img_paths = glob.glob(osp.join(dir_path, '*.jpg'))
|
|
49
|
+
pattern = re.compile(r'p([-\d]+)_s(\d)')
|
|
50
|
+
|
|
51
|
+
data = []
|
|
52
|
+
for img_path in img_paths:
|
|
53
|
+
pid, _ = map(int, pattern.search(img_path).groups())
|
|
54
|
+
pid = self.dataset_name + "_" + str(pid)
|
|
55
|
+
camid = self.dataset_name + "_0"
|
|
56
|
+
data.append((img_path, pid, camid))
|
|
57
|
+
|
|
58
|
+
return data
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: liaoxingyu
|
|
4
|
+
@contact: liaoxingyu2@jd.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import glob
|
|
8
|
+
import os.path as osp
|
|
9
|
+
import re
|
|
10
|
+
|
|
11
|
+
from .bases import ImageDataset
|
|
12
|
+
from ..datasets import DATASET_REGISTRY
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@DATASET_REGISTRY.register()
|
|
16
|
+
class DukeMTMC(ImageDataset):
|
|
17
|
+
"""DukeMTMC-reID.
|
|
18
|
+
|
|
19
|
+
Reference:
|
|
20
|
+
- Ristani et al. Performance Measures and a Data Set for Multi-Target, Multi-Camera Tracking. ECCVW 2016.
|
|
21
|
+
- Zheng et al. Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro. ICCV 2017.
|
|
22
|
+
|
|
23
|
+
URL: `<https://github.com/layumi/DukeMTMC-reID_evaluation>`_
|
|
24
|
+
|
|
25
|
+
Dataset statistics:
|
|
26
|
+
- identities: 1404 (train + query).
|
|
27
|
+
- images:16522 (train) + 2228 (query) + 17661 (gallery).
|
|
28
|
+
- cameras: 8.
|
|
29
|
+
"""
|
|
30
|
+
dataset_dir = 'DukeMTMC-reID'
|
|
31
|
+
dataset_url = 'http://vision.cs.duke.edu/DukeMTMC/data/misc/DukeMTMC-reID.zip'
|
|
32
|
+
dataset_name = "dukemtmc"
|
|
33
|
+
|
|
34
|
+
def __init__(self, root='datasets', **kwargs):
|
|
35
|
+
# self.root = osp.abspath(osp.expanduser(root))
|
|
36
|
+
self.root = root
|
|
37
|
+
self.dataset_dir = osp.join(self.root, self.dataset_dir)
|
|
38
|
+
self.train_dir = osp.join(self.dataset_dir, 'bounding_box_train')
|
|
39
|
+
self.query_dir = osp.join(self.dataset_dir, 'query')
|
|
40
|
+
self.gallery_dir = osp.join(self.dataset_dir, 'bounding_box_test')
|
|
41
|
+
|
|
42
|
+
required_files = [
|
|
43
|
+
self.dataset_dir,
|
|
44
|
+
self.train_dir,
|
|
45
|
+
self.query_dir,
|
|
46
|
+
self.gallery_dir,
|
|
47
|
+
]
|
|
48
|
+
self.check_before_run(required_files)
|
|
49
|
+
|
|
50
|
+
train = self.process_dir(self.train_dir)
|
|
51
|
+
query = self.process_dir(self.query_dir, is_train=False)
|
|
52
|
+
gallery = self.process_dir(self.gallery_dir, is_train=False)
|
|
53
|
+
|
|
54
|
+
super(DukeMTMC, self).__init__(train, query, gallery, **kwargs)
|
|
55
|
+
|
|
56
|
+
def process_dir(self, dir_path, is_train=True):
|
|
57
|
+
img_paths = glob.glob(osp.join(dir_path, '*.jpg'))
|
|
58
|
+
pattern = re.compile(r'([-\d]+)_c(\d)')
|
|
59
|
+
|
|
60
|
+
data = []
|
|
61
|
+
for img_path in img_paths:
|
|
62
|
+
pid, camid = map(int, pattern.search(img_path).groups())
|
|
63
|
+
assert 1 <= camid <= 8
|
|
64
|
+
camid -= 1 # index starts from 0
|
|
65
|
+
if is_train:
|
|
66
|
+
pid = self.dataset_name + "_" + str(pid)
|
|
67
|
+
camid = self.dataset_name + "_" + str(camid)
|
|
68
|
+
data.append((img_path, pid, camid))
|
|
69
|
+
|
|
70
|
+
return data
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: xingyu liao
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from glob import glob
|
|
9
|
+
|
|
10
|
+
from fastreid.data.datasets import DATASET_REGISTRY
|
|
11
|
+
from fastreid.data.datasets.bases import ImageDataset
|
|
12
|
+
|
|
13
|
+
__all__ = ['GRID', ]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@DATASET_REGISTRY.register()
|
|
17
|
+
class GRID(ImageDataset):
|
|
18
|
+
"""GRID
|
|
19
|
+
"""
|
|
20
|
+
dataset_dir = "underground_reid"
|
|
21
|
+
dataset_name = 'grid'
|
|
22
|
+
|
|
23
|
+
def __init__(self, root='datasets', **kwargs):
|
|
24
|
+
self.root = root
|
|
25
|
+
self.train_path = os.path.join(self.root, self.dataset_dir, 'images')
|
|
26
|
+
|
|
27
|
+
required_files = [self.train_path]
|
|
28
|
+
self.check_before_run(required_files)
|
|
29
|
+
|
|
30
|
+
train = self.process_train(self.train_path)
|
|
31
|
+
|
|
32
|
+
super().__init__(train, [], [], **kwargs)
|
|
33
|
+
|
|
34
|
+
def process_train(self, train_path):
|
|
35
|
+
data = []
|
|
36
|
+
img_paths = glob(os.path.join(train_path, "*.jpeg"))
|
|
37
|
+
|
|
38
|
+
for img_path in img_paths:
|
|
39
|
+
img_name = os.path.basename(img_path)
|
|
40
|
+
img_info = img_name.split('_')
|
|
41
|
+
pid = self.dataset_name + "_" + img_info[0]
|
|
42
|
+
camid = self.dataset_name + "_" + img_info[1]
|
|
43
|
+
data.append([img_path, pid, camid])
|
|
44
|
+
return data
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: xingyu liao
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from glob import glob
|
|
9
|
+
|
|
10
|
+
from fastreid.data.datasets import DATASET_REGISTRY
|
|
11
|
+
from fastreid.data.datasets.bases import ImageDataset
|
|
12
|
+
|
|
13
|
+
__all__ = ['iLIDS', ]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@DATASET_REGISTRY.register()
|
|
17
|
+
class iLIDS(ImageDataset):
|
|
18
|
+
"""iLIDS
|
|
19
|
+
"""
|
|
20
|
+
dataset_dir = "iLIDS"
|
|
21
|
+
dataset_name = "ilids"
|
|
22
|
+
|
|
23
|
+
def __init__(self, root='datasets', **kwargs):
|
|
24
|
+
self.root = root
|
|
25
|
+
self.train_path = os.path.join(self.root, self.dataset_dir)
|
|
26
|
+
|
|
27
|
+
required_files = [self.train_path]
|
|
28
|
+
self.check_before_run(required_files)
|
|
29
|
+
|
|
30
|
+
train = self.process_train(self.train_path)
|
|
31
|
+
|
|
32
|
+
super().__init__(train, [], [], **kwargs)
|
|
33
|
+
|
|
34
|
+
def process_train(self, train_path):
|
|
35
|
+
data = []
|
|
36
|
+
file_path = os.listdir(train_path)
|
|
37
|
+
for pid_dir in file_path:
|
|
38
|
+
img_file = os.path.join(train_path, pid_dir)
|
|
39
|
+
img_paths = glob(os.path.join(img_file, "*.png"))
|
|
40
|
+
for img_path in img_paths:
|
|
41
|
+
split_path = img_path.split('/')
|
|
42
|
+
pid = self.dataset_name + "_" + split_path[-2]
|
|
43
|
+
camid = self.dataset_name + "_" + split_path[-1].split('_')[0]
|
|
44
|
+
data.append([img_path, pid, camid])
|
|
45
|
+
return data
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: xingyu liao
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from glob import glob
|
|
9
|
+
|
|
10
|
+
from fastreid.data.datasets import DATASET_REGISTRY
|
|
11
|
+
from fastreid.data.datasets.bases import ImageDataset
|
|
12
|
+
|
|
13
|
+
__all__ = ['LPW', ]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@DATASET_REGISTRY.register()
|
|
17
|
+
class LPW(ImageDataset):
|
|
18
|
+
"""LPW
|
|
19
|
+
"""
|
|
20
|
+
dataset_dir = "pep_256x128/data_slim"
|
|
21
|
+
dataset_name = "lpw"
|
|
22
|
+
|
|
23
|
+
def __init__(self, root='datasets', **kwargs):
|
|
24
|
+
self.root = root
|
|
25
|
+
self.train_path = os.path.join(self.root, self.dataset_dir)
|
|
26
|
+
|
|
27
|
+
required_files = [self.train_path]
|
|
28
|
+
self.check_before_run(required_files)
|
|
29
|
+
|
|
30
|
+
train = self.process_train(self.train_path)
|
|
31
|
+
|
|
32
|
+
super().__init__(train, [], [], **kwargs)
|
|
33
|
+
|
|
34
|
+
def process_train(self, train_path):
|
|
35
|
+
data = []
|
|
36
|
+
|
|
37
|
+
file_path_list = ['scen1', 'scen2', 'scen3']
|
|
38
|
+
|
|
39
|
+
for scene in file_path_list:
|
|
40
|
+
cam_list = os.listdir(os.path.join(train_path, scene))
|
|
41
|
+
for cam in cam_list:
|
|
42
|
+
camid = self.dataset_name + "_" + cam
|
|
43
|
+
pid_list = os.listdir(os.path.join(train_path, scene, cam))
|
|
44
|
+
for pid_dir in pid_list:
|
|
45
|
+
img_paths = glob(os.path.join(train_path, scene, cam, pid_dir, "*.jpg"))
|
|
46
|
+
for img_path in img_paths:
|
|
47
|
+
pid = self.dataset_name + "_" + scene + "-" + pid_dir
|
|
48
|
+
data.append([img_path, pid, camid])
|
|
49
|
+
return data
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
@author: sherlock
|
|
4
|
+
@contact: sherlockliao01@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import glob
|
|
8
|
+
import os.path as osp
|
|
9
|
+
import re
|
|
10
|
+
import warnings
|
|
11
|
+
|
|
12
|
+
from .bases import ImageDataset
|
|
13
|
+
from ..datasets import DATASET_REGISTRY
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@DATASET_REGISTRY.register()
|
|
17
|
+
class Market1501(ImageDataset):
|
|
18
|
+
"""Market1501.
|
|
19
|
+
|
|
20
|
+
Reference:
|
|
21
|
+
Zheng et al. Scalable Person Re-identification: A Benchmark. ICCV 2015.
|
|
22
|
+
|
|
23
|
+
URL: `<http://www.liangzheng.org/Project/project_reid.html>`_
|
|
24
|
+
|
|
25
|
+
Dataset statistics:
|
|
26
|
+
- identities: 1501 (+1 for background).
|
|
27
|
+
- images: 12936 (train) + 3368 (query) + 15913 (gallery).
|
|
28
|
+
"""
|
|
29
|
+
_junk_pids = [0, -1]
|
|
30
|
+
dataset_dir = ''
|
|
31
|
+
dataset_url = 'http://188.138.127.15:81/Datasets/Market-1501-v15.09.15.zip'
|
|
32
|
+
dataset_name = "market1501"
|
|
33
|
+
|
|
34
|
+
def __init__(self, root='datasets', market1501_500k=False, **kwargs):
|
|
35
|
+
# self.root = osp.abspath(osp.expanduser(root))
|
|
36
|
+
self.root = root
|
|
37
|
+
self.dataset_dir = osp.join(self.root, self.dataset_dir)
|
|
38
|
+
|
|
39
|
+
# allow alternative directory structure
|
|
40
|
+
self.data_dir = self.dataset_dir
|
|
41
|
+
data_dir = osp.join(self.data_dir, 'Market-1501-v15.09.15')
|
|
42
|
+
if osp.isdir(data_dir):
|
|
43
|
+
self.data_dir = data_dir
|
|
44
|
+
else:
|
|
45
|
+
warnings.warn('The current data structure is deprecated. Please '
|
|
46
|
+
'put data folders such as "bounding_box_train" under '
|
|
47
|
+
'"Market-1501-v15.09.15".')
|
|
48
|
+
|
|
49
|
+
self.train_dir = osp.join(self.data_dir, 'bounding_box_train')
|
|
50
|
+
self.query_dir = osp.join(self.data_dir, 'query')
|
|
51
|
+
self.gallery_dir = osp.join(self.data_dir, 'bounding_box_test')
|
|
52
|
+
self.extra_gallery_dir = osp.join(self.data_dir, 'images')
|
|
53
|
+
self.market1501_500k = market1501_500k
|
|
54
|
+
|
|
55
|
+
required_files = [
|
|
56
|
+
self.data_dir,
|
|
57
|
+
self.train_dir,
|
|
58
|
+
self.query_dir,
|
|
59
|
+
self.gallery_dir,
|
|
60
|
+
]
|
|
61
|
+
if self.market1501_500k:
|
|
62
|
+
required_files.append(self.extra_gallery_dir)
|
|
63
|
+
self.check_before_run(required_files)
|
|
64
|
+
|
|
65
|
+
train = lambda: self.process_dir(self.train_dir)
|
|
66
|
+
query = lambda: self.process_dir(self.query_dir, is_train=False)
|
|
67
|
+
gallery = lambda: self.process_dir(self.gallery_dir, is_train=False) + \
|
|
68
|
+
(self.process_dir(self.extra_gallery_dir, is_train=False) if self.market1501_500k else [])
|
|
69
|
+
|
|
70
|
+
super(Market1501, self).__init__(train, query, gallery, **kwargs)
|
|
71
|
+
|
|
72
|
+
def process_dir(self, dir_path, is_train=True):
|
|
73
|
+
img_paths = glob.glob(osp.join(dir_path, '*.jpg'))
|
|
74
|
+
pattern = re.compile(r'([-\d]+)_c(\d)')
|
|
75
|
+
|
|
76
|
+
data = []
|
|
77
|
+
for img_path in img_paths:
|
|
78
|
+
pid, camid = map(int, pattern.search(img_path).groups())
|
|
79
|
+
if pid == -1:
|
|
80
|
+
continue # junk images are just ignored
|
|
81
|
+
assert 0 <= pid <= 1501 # pid == 0 means background
|
|
82
|
+
assert 1 <= camid <= 6
|
|
83
|
+
camid -= 1 # index starts from 0
|
|
84
|
+
if is_train:
|
|
85
|
+
pid = self.dataset_name + "_" + str(pid)
|
|
86
|
+
camid = self.dataset_name + "_" + str(camid)
|
|
87
|
+
data.append((img_path, pid, camid))
|
|
88
|
+
|
|
89
|
+
return data
|