File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import os
5
5
import time
6
- import cv2 # install cv3, python3: http://seeb0h.github.io/howto/howto- install-homebrew-python-opencv-osx-el-capitan/
6
+ import cv2 # install cv3, python3: brew install opencv3 --with-contrib --with-python3 --without-python
7
7
# add to profile: export PYTHONPATH=$PYTHONPATH:/usr/local/Cellar/opencv3/3.2.0/lib/python3.6/site-packages/
8
8
import numpy as np
9
9
import argparse
@@ -82,10 +82,10 @@ def cat_file():
82
82
pframe = cv2 .resize (frame , dsize = (args .size , args .size ))
83
83
84
84
# prepare and normalize frame for processing:
85
- pframe = np .swapaxes (pframe , 0 , 2 )
86
- pframe = np .expand_dims (pframe , axis = 0 )
87
85
pframe = transformsImage (pframe )
88
86
pframe = torch .autograd .Variable (pframe ) # turn Tensor to variable required for pytorch processing
87
+ pframe = pframe .unsqueeze (0 )
88
+
89
89
90
90
# process via CNN model:
91
91
output = model (pframe )
You can’t perform that action at this time.
0 commit comments