ahmetgunduz / Real-time-GesRec

Real-time Hand Gesture Recognition with PyTorch on EgoGesture, NvGesture, Jester, Kinetics and UCF101
https://arxiv.org/abs/1901.10323
MIT License
619 stars 168 forks source link

about offline_test #68

Closed MDWW closed 4 years ago

MDWW commented 4 years ago

Hi, thank you for sharing the code. while I try to run offline_test.py I got an error , and I found the opts.py doesn't contain a definition of parse_opts_offline(), which is required in the offline_test.py. Besides, i wonder do i need to download the whole database to run the online/offline_test.py?

ahmetgunduz commented 4 years ago

Could you please check again with the latest commit? Also you do not need to download all the dataset but need to make sure that code will not give any exception since I used the all database.

kinfeparty commented 4 years ago

Could you please check again with the latest commit? Also you do not need to download all the dataset but need to make sure that code will not give any exception since I used the all database.

Hello ! the opts.py still doesn't contain a definition of parse_opts_offline(), so the new modify of offline_test.py doesn't work. So I use parse_opts() instead. The code still have some bug. Can you help fix it?

File "offline_test.py", line 198, in precision = calculate_precision(outputs, targets) # File "/Lun4/fdh/Real-time-GesRec/utils.py", line 155, in calculate_precision return precision_score(targets.view(-1), pred.view(-1), average = 'macro') %U4U@XT3PJF3_5B3C5~~1DE

this is my code of run-offline.sh

python3 offline_test.py \ --root_path /Lun4/fdh/Real-time-GesRec/ \ --video_path ../egogesture-dataset/image \ --annotation_path annotation_EgoGesture/egogestureall_but_None.json \ --result_path results \ --pretrain_path report/egogesture_resnext_101_Depth_32.pth \ --dataset egogesture \ --downsample 1 \ --sample_duration 32 \ --learning_rate 0.01 \ --resnet_shortcut B \ --model resnext \ --pretrain_modality Depth \ --model_depth 101 \ --batch_size 1 \ --n_classes 83 \ --n_finetune_classes 83 \ --modality Depth \ --n_threads 16 \ --checkpoint 1 \ --train_crop random \ --n_val_samples 1 \ --test_subset test \ --n_epochs 100 \

ahmetgunduz commented 4 years ago

just try to detach pred and target using arr.detach().cpu().numpy(). Honestly you can just google this