You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

vis.ipynb 152 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "id": "f6ebc90f-d3ee-4c90-9187-4030f1019166",
  7. "metadata": {},
  8. "outputs": [],
  9. "source": [
  10. "import sys\n",
  11. "sys.path.append(\"/home/shanwei-luo/userdata/mmdetection\")\n",
  12. "from mmdet.apis import (async_inference_detector, inference_detector,\n",
  13. " init_detector, show_result_pyplot)"
  14. ]
  15. },
  16. {
  17. "cell_type": "code",
  18. "execution_count": 27,
  19. "id": "a51a9ad6-b8f4-4c77-a87c-c7d402480d47",
  20. "metadata": {},
  21. "outputs": [],
  22. "source": [
  23. "config_file = 'work_dirs/AD_dsxw_test03/AD_dsxw_test03.py'\n",
  24. "checkpoint_file = 'work_dirs/AD_dsxw_test03/epoch_20.pth'\n",
  25. "img_path = '/home/shanwei-luo/userdata/datasets/dsxw_test/images/'"
  26. ]
  27. },
  28. {
  29. "cell_type": "code",
  30. "execution_count": 28,
  31. "id": "d50982fc-bc48-4dca-b192-0fbacc65d868",
  32. "metadata": {},
  33. "outputs": [
  34. {
  35. "name": "stdout",
  36. "output_type": "stream",
  37. "text": [
  38. "load checkpoint from local path: work_dirs/AD_dsxw_test03/epoch_20.pth\n"
  39. ]
  40. }
  41. ],
  42. "source": [
  43. "model = init_detector(config_file, checkpoint_file, device='cuda:0')"
  44. ]
  45. },
  46. {
  47. "cell_type": "code",
  48. "execution_count": 98,
  49. "id": "a1ade22e-7130-46ae-aa57-409585cc788e",
  50. "metadata": {},
  51. "outputs": [
  52. {
  53. "name": "stdout",
  54. "output_type": "stream",
  55. "text": [
  56. "/home/shanwei-luo/userdata/datasets/dsxw_test/images/21000160.jpg\n"
  57. ]
  58. }
  59. ],
  60. "source": [
  61. "import os\n",
  62. "import random\n",
  63. "imgs = os.listdir(img_path)\n",
  64. "img_id = random.randint(0, len(imgs))\n",
  65. "img = imgs[img_id]\n",
  66. "img = '/home/shanwei-luo/userdata/datasets/dsxw_test/images/'+img\n",
  67. "print(img)"
  68. ]
  69. },
  70. {
  71. "cell_type": "code",
  72. "execution_count": 101,
  73. "id": "feb228fa-b0cd-44ce-bcaa-802f4ce741ef",
  74. "metadata": {},
  75. "outputs": [
  76. {
  77. "data": {

No Description

Contributors (3)