Example #1
0
# -*- coding: utf-8 -*-

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()
Example #2
0
# -*- coding: utf-8 -*-

from utils.search_modules import SearchModules
from pyretri.config import get_defaults_cfg

models = SearchModules()
extracts = SearchModules()

models.add(
    "market_res50", {
        "name": "ft_net",
        "ft_net": {
            "load_checkpoint": "/data/my_model_zoo/res50_market1501.pth"
        }
    })
extracts.add(
    "market_res50", {
        "assemble": 1,
        "extractor": {
            "name": "ReIDSeries",
            "ReIDSeries": {
                "extract_features": ["output"],
            }
        },
        "splitter": {
            "name": "Identity",
        },
        "aggregators": {
            "names": ["GAP"]
        },
    })
Example #3
0
# -*- coding: utf-8 -*-

from utils.search_modules import SearchModules
from pyretri.config import get_defaults_cfg

indexes = SearchModules()
evaluates = SearchModules()

indexes.add(
    "pca_wo_whiten", {
        "gallery_fea_dir": "",
        "query_fea_dir": "",
        "feature_names": [],
        "dim_processors": {
            "names": ["L2Normalize", "PCA", "L2Normalize"],
            "PCA": {
                "whiten": False,
                "train_fea_dir": "",
                "proj_dim": 512,
                "l2": True,
            }
        },
        "feature_enhancer": {
            "name": "Identity"
        },
        "metric": {
            "name": "KNN"
        },
        "re_ranker": {
            "name": "Identity"
        }
# -*- coding: utf-8 -*-

from utils.search_modules import SearchModules
from pyretri.config import get_defaults_cfg

models = SearchModules()
extracts = SearchModules()

models.add("imagenet_vgg16", {
    "name": "vgg16",
    "vgg16": {
        "load_checkpoint": "torchvision://vgg16"
    }
})
extracts.add(
    "imagenet_vgg16", {
        "extractor": {
            "name": "VggSeries",
            "VggSeries": {
                "extract_features": ["all"],
            }
        },
        "splitter": {
            "name": "Identity",
        },
        "aggregators": {
            "names": ["Crow", "GAP", "GMP", "GeM", "SPoC"]
        },
    })

models.add("imagenet_res50", {
Example #5
0
# -*- coding: utf-8 -*-

from utils.search_modules import SearchModules
from pyretri.config import get_defaults_cfg

pre_processes = SearchModules()

pre_processes.add(
    "Shorter256Center224", {
        "batch_size": 32,
        "folder": {
            "name": "Folder"
        },
        "collate_fn": {
            "name": "CollateFn"
        },
        "transformers": {
            "names": ["ShorterResize", "CenterCrop", "ToTensor", "Normalize"],
            "ShorterResize": {
                "size": 256
            },
            "CenterCrop": {
                "size": 224
            },
            "Normalize": {
                "mean": [0.485, 0.456, 0.406],
                "std": [0.229, 0.224, 0.225]
            }
        }
    })