Skip to content

Commit

Permalink
add yolov8 mask support, improve mask processing speed by 4-5x (#1039)
Browse files Browse the repository at this point in the history
Co-authored-by: fatih c. akyon <[email protected]>
  • Loading branch information
mayrajeo and fcakyon authored Jun 2, 2024
1 parent 75cbff1 commit 0191fbb
Show file tree
Hide file tree
Showing 24 changed files with 892 additions and 363 deletions.
Binary file added demo/demo_data/prediction_visual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 26 additions & 43 deletions demo/inference_for_mmdetection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -76,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -106,7 +106,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -153,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -169,7 +169,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -179,7 +179,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 36,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -206,7 +206,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -237,7 +237,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -247,7 +247,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 38,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -274,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -283,20 +283,20 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"ObjectPrediction<\n",
" bbox: BoundingBox: <(448, 310, 494, 340), w: 46, h: 30>,\n",
" mask: <sahi.annotation.Mask object at 0x7f64434e96d0>,\n",
" mask: <sahi.annotation.Mask object>,\n",
" score: PredictionScore: <value: 0.9975390434265137>,\n",
" category: Category: <id: 2, name: car>>"
]
},
"execution_count": 25,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -314,7 +314,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -401,7 +401,7 @@
" 'area': 1199}"
]
},
"execution_count": 26,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -419,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -536,7 +536,7 @@
" 'area': 1118}"
]
},
"execution_count": 10,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -554,16 +554,16 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<imantics.annotation.Annotation at 0x7f645d8c2190>"
"<imantics.annotation.Annotation>"
]
},
"execution_count": 27,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -581,7 +581,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -604,7 +604,7 @@
"}>"
]
},
"execution_count": 28,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -629,7 +629,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -656,7 +656,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -759,26 +759,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "python3",
"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.9.16"
},
"vscode": {
"interpreter": {
"hash": "f2680c47b11e1b3873482f0b7ab37c9292181f84f7b4413a77eb41d52d22c05d"
}
}
},
"nbformat": 4,
Expand Down
549 changes: 434 additions & 115 deletions demo/inference_for_yolov8.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 0191fbb

Please sign in to comment.