Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions examples/COLAB/COLAB_3miceDemo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
},
"outputs": [],
"source": [
"# Installs a CUDA version compatible with tensorflow on COLAB\n",
"!apt update && apt install cuda-11-8\n",
"\n",
"# Install the latest DeepLabCut version:\n",
"!pip install \"deeplabcut[tf]\""
]
Expand Down
47 changes: 24 additions & 23 deletions examples/COLAB/COLAB_DEMO_SuperAnimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
},
"outputs": [],
"source": [
"!apt update && apt install cuda-11-8\n",
"!pip install deeplabcut[tf,modelzoo]"
]
},
Expand All @@ -80,12 +81,12 @@
},
{
"cell_type": "markdown",
"source": [
"## Please select a video you want to run SuperAnimal-X on:"
],
"metadata": {
"id": "GXf8N4v28Xqo"
}
},
"source": [
"## Please select a video you want to run SuperAnimal-X on:"
]
},
{
"cell_type": "code",
Expand All @@ -110,14 +111,14 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "A8sDYMa08f62"
},
"source": [
"## Next select the model you want to use, Quadruped or TopViewMouse\n",
"- See http://modelzoo.deeplabcut.org/ for more details on these models\n",
"- The pcutoff is for visualization only, namely only keypoints with a value over what you set are shown. 0 is low confidience, 1 is perfect confidience of the model."
],
"metadata": {
"id": "A8sDYMa08f62"
}
]
},
{
"cell_type": "code",
Expand All @@ -133,12 +134,12 @@
},
{
"cell_type": "markdown",
"source": [
"## Okay, let's go! 🐭🦓🐻"
],
"metadata": {
"id": "zsB0pGtj9Luq"
}
},
"source": [
"## Okay, let's go! 🐭🦓🐻"
]
},
{
"cell_type": "code",
Expand All @@ -163,18 +164,23 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "gPLZSBpD34Mj"
},
"source": [
"## Let's view the video in Colab:\n",
"- otherwise, you can download and look at the video from the left side of your screen! It will end with _labeled.mp4\n",
"- If your data doesn't work as well as you'd like, consider fine-tuning our model on your data, changing the pcutoff, changing the scale-range\n",
"(pick values smaller and larger than your video image input size). See our repo for more details."
],
"metadata": {
"id": "gPLZSBpD34Mj"
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ejFJ1Pbg33i6"
},
"outputs": [],
"source": [
"from base64 import b64encode\n",
"from IPython.display import HTML\n",
Expand All @@ -186,12 +192,7 @@
" <source src=\"%s\" type=\"video/mp4\">\n",
"</video>\n",
"\"\"\" % data_url)"
],
"metadata": {
"id": "ejFJ1Pbg33i6"
},
"execution_count": null,
"outputs": []
]
}
],
"metadata": {
Expand Down Expand Up @@ -225,4 +226,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
130 changes: 70 additions & 60 deletions examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"accelerator": "GPU",
"colab": {
"name": "Colab_DEMO_mouse_openfield.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"display_name": "Python [default]",
"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.6.9"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/DeepLabCut/DeepLabCut/blob/master/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -74,42 +47,52 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Installs a CUDA version compatible with tensorflow on COLAB\n",
"!apt update && apt install cuda-11-8"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Ew6r4hotoQjt"
},
"outputs": [],
"source": [
"# Clone the entire deeplabcut repo so we can use the demo data:\n",
"!git clone -l -s https://github.com/DeepLabCut/DeepLabCut.git cloned-DLC-repo\n",
"%cd cloned-DLC-repo\n",
"!ls"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "yDaY78dFoxyD"
},
"outputs": [],
"source": [
"%cd /content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30\n",
"!ls"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "q23BzhA6CXxu"
},
"outputs": [],
"source": [
"# Install the latest DeepLabCut version (this will take a few minutes to install all the dependencies!)\n",
"%cd /content/cloned-DLC-repo/\n",
"!pip install \".[tf]\""
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -122,29 +105,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sXufoX6INe6w"
},
"outputs": [],
"source": [
"import deeplabcut"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Z7ZlDr3wV4D1"
},
"outputs": [],
"source": [
"#create a path variable that links to the config file:\n",
"path_config_file = '/content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30/config.yaml'\n",
"\n",
"# Loading example data set:\n",
"deeplabcut.load_demo_data(path_config_file)"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -158,9 +141,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "_pOvDq_2oEJW"
},
"outputs": [],
"source": [
"#let's also change the display and save_iters just in case Colab takes away the GPU... \n",
"#if that happens, you can reload from a saved point. Typically, you want to train to 200,000 + iterations.\n",
Expand All @@ -170,9 +155,7 @@
"\n",
"#this will run until you stop it (CTRL+C), or hit \"STOP\" icon, or when it hits the end (default, 1.03M iterations). \n",
"#Whichever you chose, you will see what looks like an error message, but it's not an error - don't worry...."
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -196,17 +179,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "nv4zlbrnoEJg"
},
"outputs": [],
"source": [
"%matplotlib notebook\n",
"deeplabcut.evaluate_network(path_config_file,plotting=True)\n",
"\n",
"# Here you want to see a low pixel error! Of course, it can only be as good as the labeler, so be sure your labels are good!"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -234,15 +217,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Y_LZiS_0oEJl"
},
"outputs": [],
"source": [
"videofile_path = ['/content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30/videos/m3v1mp4.mp4'] #Enter the list of videos to analyze.\n",
"deeplabcut.analyze_videos(path_config_file,videofile_path, videotype='.mp4')"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -256,14 +239,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "6aDF7Q7KoEKE"
},
"outputs": [],
"source": [
"deeplabcut.create_labeled_video(path_config_file,videofile_path)"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -277,14 +260,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "gX21zZbXoEKJ"
},
"outputs": [],
"source": [
"deeplabcut.plot_trajectories(path_config_file,videofile_path)"
],
"execution_count": null,
"outputs": []
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"name": "Colab_DEMO_mouse_openfield.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python [default]",
"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.6.9"
}
]
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading