From b74b9c54247177c82493f180617d7551de8e2bb1 Mon Sep 17 00:00:00 2001
From: natanielruiz <nataniel777@hotmail.com>
Date: 星期二, 26 九月 2017 03:47:06 +0800
Subject: [PATCH] Before SR experiments

---
 practice/.ipynb_checkpoints/smoothing_ypr-checkpoint.ipynb |   50 +++++++++++++++++++++++++++++---------------------
 1 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/practice/.ipynb_checkpoints/smoothing_ypr-checkpoint.ipynb b/practice/.ipynb_checkpoints/smoothing_ypr-checkpoint.ipynb
index a411c30..cd62e38 100644
--- a/practice/.ipynb_checkpoints/smoothing_ypr-checkpoint.ipynb
+++ b/practice/.ipynb_checkpoints/smoothing_ypr-checkpoint.ipynb
@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 156,
+   "execution_count": 1,
    "metadata": {
     "collapsed": false
    },
@@ -17,22 +17,22 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 157,
+   "execution_count": 2,
    "metadata": {
     "collapsed": false
    },
    "outputs": [],
    "source": [
-    "video_path = '../data/video/SGT036_2016_07_25_pivothead_AVI.avi'\n",
-    "bbox_path = '../data/video/annotations/SGT036_childface.txt'\n",
+    "video_path = '../data/video/SWC016_2016_04_08_pivothead_AVI.avi'\n",
+    "bbox_path = '../data/video/annotations/SWC016_childface.txt'\n",
     "\n",
-    "annot_path = '../output/video/output-SGT036_resnet18_cr_epoch_1.txt'\n",
-    "output_string = 'SGT036_resnet18_cr_epoch_1_flat_smoothed'"
+    "annot_path = '../output/video/output-SWC016_normal_1e-5_epoch_20.txt'\n",
+    "output_string = 'SWC016_normal_1e-5_epoch_20_smooth'"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 158,
+   "execution_count": 3,
    "metadata": {
     "collapsed": false
    },
@@ -41,9 +41,9 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "[-6.069214 -0.831665  0.53318  ..., -3.836042 -3.868275 -2.377155]\n",
-      "(8508,)\n",
-      "(53464,)\n"
+      "[ -1.15884  -14.885593 -16.727406 ..., -57.590378 -56.963156 -58.641377]\n",
+      "(9322,)\n",
+      "(63691,)\n"
      ]
     }
    ],
@@ -93,7 +93,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 159,
+   "execution_count": 4,
    "metadata": {
     "collapsed": false
    },
@@ -107,31 +107,39 @@
     }
    ],
    "source": [
-    "window_len = 6\n",
+    "window_len = 7\n",
     "pad = window_len / 2\n",
     "window = 'flat'\n",
+    "window_2 = 'flat'\n",
+    "window_len_2 = 7\n",
+    "pad_2 = window_len_2 / 2\n",
     "\n",
     "s = np.r_[y[window_len-1:0:-1],y,y[-2:-window_len-1:-1]]\n",
     "t = np.r_[p[window_len-1:0:-1],p,p[-2:-window_len-1:-1]]\n",
     "u = np.r_[r[window_len-1:0:-1],r,r[-2:-window_len-1:-1]]\n",
     "\n",
-    "xa = np.r_[x_min_arr[window_len-1:0:-1],x_min_arr,x_min_arr[-2:-window_len-1:-1]]\n",
-    "xb = np.r_[x_max_arr[window_len-1:0:-1],x_max_arr,x_max_arr[-2:-window_len-1:-1]]\n",
-    "ya = np.r_[y_min_arr[window_len-1:0:-1],y_min_arr,y_min_arr[-2:-window_len-1:-1]]\n",
-    "yb = np.r_[y_max_arr[window_len-1:0:-1],y_max_arr,y_max_arr[-2:-window_len-1:-1]]\n",
+    "xa = np.r_[x_min_arr[window_len_2-1:0:-1],x_min_arr,x_min_arr[-2:-window_len_2-1:-1]]\n",
+    "xb = np.r_[x_max_arr[window_len_2-1:0:-1],x_max_arr,x_max_arr[-2:-window_len_2-1:-1]]\n",
+    "ya = np.r_[y_min_arr[window_len_2-1:0:-1],y_min_arr,y_min_arr[-2:-window_len_2-1:-1]]\n",
+    "yb = np.r_[y_max_arr[window_len_2-1:0:-1],y_max_arr,y_max_arr[-2:-window_len_2-1:-1]]\n",
     "\n",
     "if window == 'flat':\n",
     "    w=np.ones(window_len, 'd')\n",
     "else:\n",
     "    w=eval('np.' + window + '(window_len)')\n",
+    "    \n",
+    "if window_2 == 'flat':\n",
+    "    w_2=np.ones(window_len_2, 'd')\n",
+    "else:\n",
+    "    w_2=eval('np.' + window_2 + '(window_len_2)')    \n",
     "\n",
     "y = np.convolve(w / w.sum(), s, mode='valid')[pad:-pad]\n",
     "p = np.convolve(w / w.sum(), t, mode='valid')[pad:-pad]\n",
     "r = np.convolve(w / w.sum(), u, mode='valid')[pad:-pad]\n",
-    "x_min_arr = np.convolve(w / w.sum(), xa, mode='valid')[pad:-pad]\n",
-    "x_max_arr = np.convolve(w / w.sum(), xb, mode='valid')[pad:-pad]\n",
-    "y_min_arr = np.convolve(w / w.sum(), ya, mode='valid')[pad:-pad]\n",
-    "y_max_arr = np.convolve(w / w.sum(), yb, mode='valid')[pad:-pad]\n",
+    "x_min_arr = np.convolve(w_2 / w_2.sum(), xa, mode='valid')[pad_2:-pad_2]\n",
+    "x_max_arr = np.convolve(w_2 / w_2.sum(), xb, mode='valid')[pad_2:-pad_2]\n",
+    "y_min_arr = np.convolve(w_2 / w_2.sum(), ya, mode='valid')[pad_2:-pad_2]\n",
+    "y_max_arr = np.convolve(w_2 / w_2.sum(), yb, mode='valid')[pad_2:-pad_2]\n",
     "\n",
     "pose_dict = {}\n",
     "bbox_dict = {}\n",
@@ -151,7 +159,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 160,
+   "execution_count": 7,
    "metadata": {
     "collapsed": false
    },

--
Gitblit v1.8.0