ermongroup / Wifi_Activity_Recognition

Code for IEEE Communication Magazine (A Survey on Behaviour Recognition Using WiFi Channle State Information)
GNU General Public License v3.0
251 stars 78 forks source link

Issue with the code! #1

Closed muasifk closed 6 years ago

muasifk commented 6 years ago

Dear authors,

Firstly, thanks for sharing the dataset and the code. While running the file "cross_vali_data_convert_merge", it reads the input files but it returns the following error when reading the annotation files.

`cross_vali_data_convert_merge.py', wdir='H:/traces/wlan-csi-stanford') input_file_name= ./Dataset\input_161219_siamak_bed_1.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_10.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_2.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_3.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_4.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_5.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_6.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_7.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_8.dat.csv input_file_name= ./Dataset\input_161219_siamak_bed_9.dat.csv annotation_file_name= ./Dataset\annotation_siamak_bed_1.csv Traceback (most recent call last):

File "", line 1, in runfile('H:/traces/wlan-csi-stanford/cross_vali_data_convert_merge.py', wdir='H:/traces/wlan-csi-stanford')

File "C:\Users\Muhammad\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile execfile(filename, namespace)

File "C:\Users\Muhammad\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "H:/traces/wlan-csi-stanford/cross_vali_data_convert_merge.py", line 107, in x, y = dataimport(filepath1, filepath2)

File "H:/traces/wlan-csi-stanford/cross_vali_data_convert_merge.py", line 43, in dataimport y = np.zeros(((len(tmp2) + 1 - 2 * window_size)/slide_size+1,8))

TypeError: 'float' object cannot be interpreted as an integer`

Hirokazu-Narui commented 6 years ago

Thanks for comment on issue. In my environment, it isn't shown. But maybe it works.

cross_vali_data_convert_merge.py, line 43 (Before) y = np.zeros(((len(tmp2) + 1 - 2 window_size)/slide_size+1,8)) (After) y = np.zeros(((len(tmp2) + 1 - 2 window_size)//slide_size+1,8))

Would you add "/", and try it again? Thanks

muasifk commented 6 years ago

Thanks, Hirokazu. It worked for me.

Can I understand from you, 1) What is the original shape of the input data? The paper mentioned that CSI is acquired from 3 antennas for 30 subcarriers, so each input data point should be 90D. However, reading the CSV file in the first step (before reshaping and rolling) returns xx of shape 900x90000? 2) Why is it reshaped to 90x1000x90?

Thank you, _Asif

Hirokazu-Narui commented 6 years ago

Hi Asif, Thanks for the comment.

xx of shape 900x90000? -> 900 samples x (90features x 1000timesteps) This is because I reshape it to "#of samples x 90 features(3antenna x 30subcarrier) x 1000timesteps" in the cross_vali_recurrent_network_wifi_activity.py.

We put these samples to LSTM in training and inference.

muasifk commented 6 years ago

Thanks Hirokazu,

Understood till now. I actually need to use only the dataset for fall detection. In that case, I will not remove lines with label=no_activity. My problem will be a binary classification to detect the fall in the dataset.

I need to apply LSTM as well as CNN to the dataset. The shape of the input data shall be different for CNN as in CNN, we feed the whole bunch of feature vectors to the model. I am trying to change the dataset for this purpose. Can you help me in this regard?

Hirokazu-Narui commented 6 years ago

Hi Asif,

Actually, I'm doing almost the same things. I changed input shape as (time x # of subcarrier x # of antenna).

If you have some question about my data or code, please feel free to ask.

Thanks, Hiro