Skip to content

Fixe the bug in the visualization step. #2326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions demo/MMSegmentation_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"## Install MMSegmentation\n",
"This step may take several minutes. \n",
"\n",
"We use PyTorch 1.10 and CUDA 11.1 for this tutorial. You may install other versions by change the version number in pip install command. "
"We use PyTorch 1.12 and CUDA 11.3 for this tutorial. You may install other versions by change the version number in pip install command. "
]
},
{
Expand Down Expand Up @@ -67,13 +67,13 @@
"outputs": [],
"source": [
"# Install PyTorch\n",
"!conda install pytorch=1.10.0 torchvision cudatoolkit=11.1 -c pytorch\n",
"!conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.3 -c pytorch\n",
"# Install mim\n",
"!pip install -U openmim\n",
"# Install mmengine\n",
"!mim install mmengine\n",
"# Install MMCV\n",
"!mim install 'mmcv >= 2.0.0rc1'"
"!mim install 'mmcv >= 2.0.0rc1'\n"
]
},
{
Expand Down Expand Up @@ -500,16 +500,17 @@
},
"outputs": [],
"source": [
"from mmseg.apis import inference_model, show_result_pyplot\n",
"from mmseg.apis import init_model, inference_model, show_result_pyplot\n",
"\n",
"model=runner.model\n",
"model.cfg=cfg\n",
"# Init the model from the config and the checkpoint\n",
"checkpoint_path = './work_dirs/tutorial/iter_200.pth'\n",
"model = init_model(cfg, checkpoint_path, 'cuda:0')\n",
"\n",
"img = mmcv.imread('iccv09Data/images/6000124.jpg')\n",
"result = inference_model(model, img)\n",
"plt.figure(figsize=(8, 6))\n",
"vis_result = show_result_pyplot(model, img, result, palette)\n",
"plt.imshow(mmcv.bgr2rgb(vis_result))"
"vis_result = show_result_pyplot(model, img, result)\n",
"plt.imshow(mmcv.bgr2rgb(vis_result))\n"
]
}
],
Expand All @@ -522,7 +523,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.7.13 ('pt1.12')",
"display_name": "Python 3.8.5 ('tensorflow')",
"language": "python",
"name": "python3"
},
Expand All @@ -536,7 +537,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.13"
"version": "3.8.5"
},
"pycharm": {
"stem_cell": {
Expand All @@ -549,7 +550,7 @@
},
"vscode": {
"interpreter": {
"hash": "ffdb7915c29738c259ec7ee5d0d1b9253c264f1fd267d45dd77f1a420396c120"
"hash": "20d4b83e0c8b3730b580c42434163d64f4b735d580303a8fade7c849d4d29eba"
}
}
},
Expand Down