Skip to content

Commit

Permalink
adding testing of detection output
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceJnz committed Jan 27, 2023
1 parent 5124c10 commit cccf97c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
69 changes: 67 additions & 2 deletions Training_Customised_Image_Detection_Model-ML4DR_v1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@
" category_index,\n",
" use_normalized_coordinates=True,\n",
" max_boxes_to_draw=5,\n",
" min_score_thresh=.5,\n",
" min_score_thresh=.4, #(0.5)\n",
" agnostic_mode=False)\n",
"\n",
"plt.imshow(cv2.cvtColor(image_np_with_detections, cv2.COLOR_BGR2RGB))\n",
Expand All @@ -941,8 +941,73 @@
"metadata": {},
"outputs": [],
"source": [
"print(detections)"
"x, y, c = image_np.shape\n",
"print(x,y,c)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(detections['detection_boxes'][0:6]*[x,y,x,y])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(detections['detection_scores'][0:6])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(category_index)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(len(detections))\n",
"print(list(detections))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(detections['detection_classes']+1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(num_detections)\n",
"print(len(detections['detection_scores']))\n",
"print(len(detections['detection_boxes']))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion Training_Customised_Image_Detection_Model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cccf97c

Please sign in to comment.