dimstudio / SharpFlow

Script for analysing on real time the sensor data
1 stars 3 forks source link

Add counter examples for action classification #3

Closed dimstudio closed 4 years ago

dimstudio commented 4 years ago

The idea is to create fake intervals as counter example to the intervals. For example we have 120 ping pong strokes as time intervals. We generate from the same dataset 120 non-strokes from the same dataset. Here is my attempt:

# add fake intervals adding random time offset

import random
xm = dfAnn.duration.median()
dfAnnFake = dfAnn.copy()
format = lambda x: x + pd.DateOffset(seconds=float(random.randint(-int(xm*100), int(xm*100)))/100)
dfAnnFake.start = dfAnn.start.map(format)
dfAnnFake.end = dfAnnFake.start + pd.to_timedelta(dfAnnFake.duration, unit='s')
HansBambel commented 4 years ago

We can also sample random intervalls as non-strokes.

dimstudio commented 4 years ago

I discussed this with my colleague yesterday. This would require changing the current batch approach using a TCP server into a streaming approach which continuously streams data to SharpFlow. This is a bit complex at the moment. We can put this on wait. At the moment SharpFlow implements a TCP server which expects individual intervals (i.e. table tennis strokes). The segmentation and stroke recognition should take place on the data collection software.