ohjay / hmm_activity_recognition

Human activity recognition with HMMs
3 stars 1 forks source link

roi_h = int(h * dense_params['roi_h']) TypeError: 'NoneType' object is not subscriptable #2

Closed RahulB117 closed 5 years ago

RahulB117 commented 5 years ago

Hi, I've been trying to run this project but after running python main.py extract , I got the following errors :

---------- BEGIN VIDEO DIRECTORY PROCESSING [o] Video directory: /Users/Rahul/hmm_activity_recognition/data/kth\boxing --- 0 [o] Video path: /Users/Rahul/hmm_activity_recognition/data/kth\boxing\person01_boxing_d1_uncomp.avi [o] including feature "edge" [o] including feature "centroid" [o] including feature "optical_flow" [o] including feature "freq_optical_flow" [o] including feature "dense_optical_flow" [o] including feature "freq_dense_optical_flow" [o] including feature "divergence" [o] including feature "curl" [o] including feature "avg_velocity" Traceback (most recent call last): File "main.py", line 73, in eval(command)(config=config) File "main.py", line 21, in extract_features ef.process_all_video_dirs(ef_params['base_dir'], save_path=save_path, config=ef_params) File "C:\Users\Rahul\hmm_activity_recognition\scripts\extract_features.py", line 460, in process_all_video_dirs process_video_dir(fvideo_dir, save_path=os.path.join(save_dir, name + '.h5'), config=config) File "C:\Users\Rahul\hmm_activity_recognition\scripts\extract_features.py", line 487, in process_video_dir video_features_seq = process_video(video_path, save_path=None, config=config) File "C:\Users\Rahul\hmm_activity_recognition\scripts\extract_features.py", line 691, in process_video prev_img=prev_img, img=frame_edge, dense_params=dense_params, n_bins=div_n_bins) File "C:\Users\Rahul\hmm_activity_recognition\scripts\extract_features.py", line 396, in feat_divergence flow = compute_dense_optical_flow(prev_img, img, dense_params) File "C:\Users\Rahul\hmm_activity_recognition\scripts\extract_features.py", line 252, in compute_dense_optical_flow roi_h = int(h * dense_params['roi_h']) TypeError: 'NoneType' object is not subscriptable

How do I solve this? Thanks in advance

ohjay commented 5 years ago

You need to include the dense_params settings in the config file. As an example of a working config file (at least on my end), see owen.yaml.

RahulB117 commented 5 years ago

Hey, good morning,

Thank you so much for the swift reply. I’ll run the solution and let you know if it worked.

Cheers

Sent from my iPhone

On 31-Mar-2019, at 1:29 AM, Owen Jow notifications@github.com wrote:

Closed #2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.