mirror of https://github.com/JDAI-CV/fast-reid.git
90 lines
1.9 KiB
Plaintext
90 lines
1.9 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%reload_ext autoreload\n",
|
|
"%autoreload 2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import torch\n",
|
|
"from fastai.vision import *\n",
|
|
"\n",
|
|
"from engine.interpreter import ReidInterpretation\n",
|
|
"\n",
|
|
"from data import get_data_bunch\n",
|
|
"from modeling import build_model\n",
|
|
"from config import cfg\n",
|
|
"cfg.DATASETS.NAMES = ('market1501',)\n",
|
|
"cfg.DATASETS.TEST_NAMES = 'market1501'\n",
|
|
"cfg.MODEL.BACKBONE = 'resnet50'\n",
|
|
"\n",
|
|
"data_bunch, test_labels, num_query = get_data_bunch(cfg)\n",
|
|
"\n",
|
|
"model = build_model(cfg, 10)\n",
|
|
"model.load_params_wo_fc(torch.load('logs/2019.8.14/market/baseline/models/model_149.pth')['model'])\n",
|
|
"learn = Learner(data_bunch, model)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from fastai.basic_data import *"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"reidInterpreter = ReidInterpretation(learn, test_labels, num_query)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"scrolled": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"reidInterpreter.plot_top_error(20, False)"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.7.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|