Skip to content

Commit

Permalink
save cleaned data to a dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
InfantLab committed May 3, 2020
1 parent ee8d6bf commit a527016
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 113 deletions.
22 changes: 18 additions & 4 deletions Step0.GettingStarted.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
"source": [
"### 0.2 - Load python libraries\n",
"\n",
"There are a handful of python libraries that we use for things like image manipulation, file operations, maths and stats. Many are probably already installed by default such as `os, math, numpy, matplotlib`. Others need adding to our python environment. \n",
"There are a handful of python libraries that we use for things like image manipulation, file operations, maths and stats. Many are probably already installed by default such as `os, math, numpy, pandas, matplotlib`. Others need adding to our python environment. \n",
"\n",
"**If you are using conda then run the following command to install all the main libraries.**\n",
"```\n",
"conda install glob2 opencv \n",
"conda install glob2 opencv pyarrow \n",
"```\n",
"#### Troubleshooting\n",
"If when you run the code in Steps 1, 2 & 3 you might ee an error like `ModuleNotFoundError: No module named 'glob'` this is because that python module needs to be installed on your computer. If you use Anaconda, the missing module can usually be installed with the command `conda install glob`."
"If when you run the code in Steps 1, 2 & 3 you might see an error like `ModuleNotFoundError: No module named 'glob'` this is because that python module needs to be installed on your computer. If you use Anaconda, the missing module can usually be installed with the command `conda install glob`."
]
},
{
Expand Down Expand Up @@ -91,7 +91,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### 0.4 - Using Jupyter with network drives\n",
"## 0.4 SyncPy \n",
"\n",
"The data analysis in Step 3 uses the SyncPy library. This needs to be installed as source code in it's own directory in the same folder and at same level as the current VASC project. So if VASC was installed in your 'Projects' folder, SyncPy should go there too. \n",
"```\n",
"/Caspar/Projects/VASC\n",
"/Caspar/Projects/SyncPy\n",
"```\n",
"https://github.com/infantlab/syncpy "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 0.5 - Using Jupyter with network drives\n",
"\n",
"By default Jupyter launched from Anaconda Navigator will open it in your home directory. It then might not be possible to access files on a network drive you need to first launch a command window for the correct Jupyter environment. Then use command to launch Jupyter itself. \n",
"\n",
Expand Down
13 changes: 7 additions & 6 deletions Step1.ProcessVideo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@
"outputs": [],
"source": [
"# where's the project folder? (with trailing slash)\n",
"# projectpath = os.getcwd() + \"\\\\..\\\\lookit\\\\\"\n",
"projectpath = \"U:\\\\Caspar\\\\\"\n",
"projectpath = os.getcwd() + \"\\\\..\\\\lookit\\\\\"\n",
"# projectpath = \"U:\\\\Caspar\\\\\"\n",
"videos_in = projectpath \n",
"\n",
"# locations of videos and output\n",
"videos_out = \"E:\\\\SpeakNSign\\\\\" + \"out\"\n",
"# videos_out = \"E:\\\\SpeakNSign\\\\\" + \"out\"\n",
"videos_out = projectpath + \"\\\\out\" \n",
"videos_out_openpose = videos_out + \"\\\\openpose\"\n",
"videos_out_timeseries = videos_out + \"\\\\timeseries\"\n",
"videos_out_analyses = videos_out + \"\\\\analyses\"\n",
Expand Down Expand Up @@ -321,10 +322,10 @@
"params = dict()\n",
"params[\"write_json\"] = videos_out_openpose\n",
"# params[\"write_images\"] = videos_out_openpose #for the moment dump images in output file - TODO name subfolder\n",
"params[\"disable_blending\"] = \"true\"\n",
"#params[\"disable_blending\"] = \"false\"\n",
"params[\"display\"] = \"1\"\n",
"\n",
"createoutputvideo = False #do we get openpose to create a video output?"
"createoutputvideo = True #do we get openpose to create a video output?"
]
},
{
Expand Down Expand Up @@ -564,7 +565,7 @@
" i += 1\n",
" #end loop for this video\n",
" people = int(max(npeople))\n",
" print(\"Video\", vid, \".\", cam, \"has {0} people detected.\".format(people))\n",
" print(\"Video\", vid, cam, \"has {0} people detected.\".format(people))\n",
" videos[vid][cam][\"maxpeople\"] = people\n",
" videos[vid][cam][\"v\"] = v #might be useful to have these indices available\n",
" videos[vid][cam][\"c\"] = c\n",
Expand Down
Loading

0 comments on commit a527016

Please sign in to comment.