Skip to content

Commit

Permalink
egocentric align
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Dec 9, 2024
1 parent 9c62b82 commit 25153da
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 15 deletions.
File renamed without changes.
62 changes: 47 additions & 15 deletions docs/nb/egocentric_align.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"id": "54298ed3",
"metadata": {},
"outputs": [
Expand All @@ -130,7 +130,7 @@
"<IPython.core.display.HTML object>"
]
},
"execution_count": 6,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -198,7 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 17,
"id": "dd458e84",
"metadata": {},
"outputs": [
Expand All @@ -211,7 +211,7 @@
"<IPython.core.display.HTML object>"
]
},
"execution_count": 10,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -225,14 +225,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "0f659939",
"execution_count": 11,
"id": "1f1e6c46",
"metadata": {},
"outputs": [],
"source": [
"# FINALLY, LET'S USE A DIFFERENT EXPERIMENT, WITH DIFFERENT BODY-PART NAMES TO SEE HOW IT BEHAVES\n",
"ANCHOR_POINT_1 = 'center' \n",
"ANCHOR_POINT_2 = 'nose' \n",
"ANCHOR_POINT_1 = 'butt/proximal tail' \n",
"ANCHOR_POINT_2 = 'snout' \n",
"DIRECTION = 0 \n",
"ANCHOR_LOCATION = (600, 300)\n",
"FILL_COLOR = (128, 120, 128) \n",
Expand All @@ -244,10 +244,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "9c654f6a",
"execution_count": 12,
"id": "588449dc",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"SIMBA COMPLETE: Video concatenated (elapsed time: 6.5711s) \tcomplete\n",
"SIMBA COMPLETE: Egocentric rotation video C:\\troubleshooting\\open_field_below\\project_folder\\videos\\rotated\\raw_clip1.mp4 complete (elapsed time: 44.5313s) \tcomplete\n",
"SIMBA COMPLETE: Egocentrically aligned data for 1 files saved in C:\\troubleshooting\\open_field_below\\project_folder\\videos\\rotated (elapsed time: 44.5873s) \tcomplete\n"
]
}
],
"source": [
"# ... AGAIN WE CREATE A NEW INSTANCE BASED ON THE UPDATED INFORMATION ABOVE, AND RUN IT.\n",
"aligner = EgocentricalAligner(anchor_1=ANCHOR_POINT_1,\n",
Expand All @@ -265,16 +275,38 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "5a70d3f8",
"execution_count": 19,
"id": "f03907d1",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
" <video width=\"600\" height=\"600\" controls> <source src=\"https://raw.githubusercontent.com/sgoldenlab/simba/master/docs/_static/img/egocentric_nb_3.webm\" type=\"video/webm\"> </video>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#EXAMPLE VIDEO EXPECTED RESULTS SNIPPET\n",
"video_url = 'https://raw.githubusercontent.com/sgoldenlab/simba/master/docs/_static/img/egocentric_nb_2.webm'\n",
"video_url = 'https://raw.githubusercontent.com/sgoldenlab/simba/master/docs/_static/img/egocentric_nb_3.webm'\n",
"HTML(f''' <video width=\"600\" height=\"600\" controls> <source src=\"{video_url}\" type=\"video/webm\"> </video>\n",
"''')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "84663ecc",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 25153da

Please sign in to comment.