fast-reid/vis_data.ipynb

90 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-08-13 13:52:25 +08:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%reload_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
2019-08-14 14:50:44 +08:00
"execution_count": 2,
2019-08-13 13:52:25 +08:00
"metadata": {},
2019-08-20 09:36:47 +08:00
"outputs": [],
2019-08-13 13:52:25 +08:00
"source": [
"import torch\n",
2019-08-20 09:36:47 +08:00
"from fastai.vision import *\n",
2019-08-13 13:52:25 +08:00
"\n",
"from engine.interpreter import ReidInterpretation\n",
"\n",
"from data import get_data_bunch\n",
2019-08-20 09:36:47 +08:00
"from modeling import build_model\n",
2019-08-13 13:52:25 +08:00
"from config import cfg\n",
2019-08-20 09:36:47 +08:00
"cfg.DATASETS.NAMES = ('market1501',)\n",
"cfg.DATASETS.TEST_NAMES = 'market1501'\n",
"cfg.MODEL.BACKBONE = 'resnet50'\n",
2019-08-13 13:52:25 +08:00
"\n",
"data_bunch, test_labels, num_query = get_data_bunch(cfg)\n",
"\n",
2019-08-20 09:36:47 +08:00
"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",
2019-08-13 13:52:25 +08:00
"learn = Learner(data_bunch, model)"
]
},
{
"cell_type": "code",
2019-08-14 14:50:44 +08:00
"execution_count": 3,
2019-08-13 13:52:25 +08:00
"metadata": {},
"outputs": [],
"source": [
2019-08-20 09:36:47 +08:00
"from fastai.basic_data import *"
2019-08-13 13:52:25 +08:00
]
},
2019-08-14 14:50:44 +08:00
{
"cell_type": "code",
2019-08-20 09:36:47 +08:00
"execution_count": 12,
2019-08-14 14:50:44 +08:00
"metadata": {},
2019-08-20 09:36:47 +08:00
"outputs": [],
2019-08-13 13:52:25 +08:00
"source": [
2019-08-20 09:36:47 +08:00
"reidInterpreter = ReidInterpretation(learn, test_labels, num_query)"
2019-08-13 13:52:25 +08:00
]
},
{
"cell_type": "code",
2019-08-20 09:36:47 +08:00
"execution_count": null,
2019-08-13 13:52:25 +08:00
"metadata": {
2019-08-20 09:36:47 +08:00
"scrolled": false
2019-08-13 13:52:25 +08:00
},
2019-08-20 09:36:47 +08:00
"outputs": [],
2019-08-14 14:50:44 +08:00
"source": [
2019-08-20 09:36:47 +08:00
"reidInterpreter.plot_top_error(20, False)"
2019-08-13 13:52:25 +08:00
]
}
],
"metadata": {
"kernelspec": {
2019-08-20 09:36:47 +08:00
"display_name": "Python 3",
2019-08-13 13:52:25 +08:00
"language": "python",
2019-08-20 09:36:47 +08:00
"name": "python3"
2019-08-13 13:52:25 +08:00
},
"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
}