示例#1
0
models.add(
    "duke_res50", {
        "name": "ft_net",
        "ft_net": {
            "load_checkpoint":
            "/home/songrenjie/projects/reID_baseline/model/ft_ResNet50/res50_duke.pth"
        }
    })
extracts.add(
    "duke_res50", {
        "assemble": 1,
        "extractor": {
            "name": "ReIDSeries",
            "ReIDSeries": {
                "extract_features": ["output"],
            }
        },
        "splitter": {
            "name": "Identity",
        },
        "aggregators": {
            "names": ["GAP"]
        },
    })

cfg = get_defaults_cfg()

models.check_valid(cfg["model"])
extracts.check_valid(cfg["extract"])
示例#2
0
from utils.search_modules import SearchModules
from pyretri.config import get_defaults_cfg

pre_processes = SearchModules()

pre_processes.add(
    "Direct256128", {
        "batch_size": 32,
        "folder": {
            "name": "Folder"
        },
        "collate_fn": {
            "name": "CollateFn"
        },
        "transformers": {
            "names": ["DirectResize", "TwoFlip", "ToTensor", "Normalize"],
            "DirectResize": {
                "size": (256, 128),
                "interpolation": 3
            },
            "Normalize": {
                "mean": [0.485, 0.456, 0.406],
                "std": [0.229, 0.224, 0.225]
            }
        }
    })

cfg = get_defaults_cfg()

pre_processes.check_valid(cfg["datasets"])
示例#3
0
        "query_fea_dir": "",
        "feature_names": [],
        "dim_processors": {
            "names": ["L2Normalize", "SVD", "L2Normalize"],
            "SVD": {
                "whiten": True,
                "train_fea_dir": "",
                "proj_dim": 511,
                "l2": True,
            }
        },
        "feature_enhancer": {
            "name": "Identity"
        },
        "metric": {
            "name": "KNN"
        },
        "re_ranker": {
            "name": "Identity"
        }
    })

evaluates.add("overall", {"evaluator": {"name": "OverAll"}})

evaluates.add("oxford_overall", {"evaluator": {"name": "OxfordOverAll"}})

cfg = get_defaults_cfg()

indexes.check_valid(cfg["index"])
evaluates.check_valid(cfg["evaluate"])