Skip to content

Commit

Permalink
colab version fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpagnon committed Jan 27, 2024
1 parent 035c6fa commit 05b57ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</br>

**`Announcement:` \
User-friendly Colab version released!\
User-friendly Colab version released! (and fixed for the new Ubuntu version, too)\
Works on any smartphone!**\
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://bit.ly/Sports2D_Colab)

Expand Down
10 changes: 5 additions & 5 deletions Sports2D/Sports2D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
" # build openpose # doing it twice seems to solve the issue\n",
" !cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j`nproc` \n",
" !cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j`nproc` \n",
" # Install body_25b model\n",
" # Install body_25b model # caffe model not available anymore -> revert to BODY_25 as default\n",
" !wget posefs1.perception.cs.cmu.edu/OpenPose/models/pose/1_25BBkg/body_25b/pose_iter_XXXXXX.caffemodel -P /content/openpose/models/pose/body_25b\n",
" !wget https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose_train/master/experimental_models/1_25BBkg/body_25b/pose_deploy.prototxt -P /content/openpose/models/pose/body_25b \n",
" # Get compatible CUDA and CuDNN versions in order to avoid `CudaSuccess (2 vs. 0) out of memory` error\n",
Expand Down Expand Up @@ -546,12 +546,12 @@
"\n",
"video_name = 'demo.mp4' #@param {type:\"string\"}\n",
"video_name = os.path.basename(video_name)\n",
"pose_model = 'BODY_25B'\n",
"pose_model = 'BODY_25'\n",
"config_dict.get('project').update({'video_dir':video_path})\n",
"config_dict.get('project').update({'video_file':video_name})\n",
"config_dict.get('project').update({'result_dir':result_path})\n",
"config_dict.get('pose').update({'pose_algo':'OPENPOSE'})\n",
"config_dict.get('pose').get('OPENPOSE').update({'openpose_model':'BODY_25B'})\n",
"config_dict.get('pose').get('OPENPOSE').update({'openpose_model':pose_model})\n",
"config_dict.get('pose').get('OPENPOSE').update({'openpose_path':openpose_path})\n",
"\n",
"video_full_path = os.path.join(video_path, video_name)\n",
Expand Down Expand Up @@ -599,7 +599,7 @@
" if install_openpose != 'Install OpenPose':\n",
" print('WARNING: OpenPose not installed!')\n",
" else:\n",
" pose_model = 'BODY_25B' #@param [\"BODY_25B\", \"BODY_25\"]\n",
" pose_model = 'BODY_25' #@param [\"BODY_25B\", \"BODY_25\"]\n",
" config_dict.get('pose').update({'pose_algo':'OPENPOSE'})\n",
" config_dict.get('pose').get('OPENPOSE').update({'openpose_model':pose_model})\n",
" \n",
Expand Down Expand Up @@ -954,7 +954,7 @@
"#@markdown Display last uploaded video after analysis:\n",
"show_last = 'Yes' #@param [\"Yes\", \"No\"]\n",
"#@markdown If \"No\", please type in the video you wish to display (check left pane for a list of them):\n",
"show_video_name = 'demo_BODY_25B.mp4' #@param {type:\"string\"}\n",
"show_video_name = 'demo_BODY_25.mp4' #@param {type:\"string\"}\n",
"\n",
"def show_local_mp4_video(file_name, width=640, height=480):\n",
" import io\n",
Expand Down
2 changes: 1 addition & 1 deletion Sports2D/detect_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def json_to_csv(json_path, frame_rate, pose_model, interp_gap_smaller_than, filt

# Retrieve coordinates
logging.info('Sorting people across frames.')
json_fnames = list(json_path.glob('*.json'))
json_fnames = sorted(list(json_path.glob('*.json')))
nb_persons_to_detect = max([len(json.load(open(json_fname))['people']) for json_fname in json_fnames])
Coords = [np.array([]).reshape(0,keypoints_nb*3)] * nb_persons_to_detect
for json_fname in json_fnames: # for each frame
Expand Down

0 comments on commit 05b57ea

Please sign in to comment.