-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ab02cb
commit e5c17a2
Showing
8 changed files
with
58 additions
and
65 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+86.9 MB
api/bin_models/v1/model_keystroke.pickle → api/bin_models/v1/voting.pickle
100644 → 100755
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
import pandas as pd | ||
import sys | ||
|
||
|
||
def array_for_predict(req_json): | ||
print('ayn') | ||
#array precisa ser de 31, e preencher com 0 o que não tiver. | ||
return [0,1,0,1] | ||
|
||
|
||
def transform_keystroke(data): | ||
df = pd.DataFrame.from_dict([data]) | ||
df.fillna(0, inplace=True) | ||
print(df.columns) | ||
|
||
df['DD.5.shift.r'] = df.get('DD.5.shift', 0) + df.get('DD.shift.r', 0) | ||
df['UD.5.shift.r'] = df.get('UD.5.r', 0) + df.get('UD.5.shift', 0) | ||
|
||
df['H.shift.r'] = df.get('H.r', 0) | ||
df['DD.shift.r.o'] = df.get('DD.r.o', 0) | ||
df['UD.shift.r.o'] = df.get('UD.r.o', 0) + df.get('UD.shift.o', 0) | ||
|
||
df.drop(columns=['UD.r.o', 'UD.shift.o', 'H.r', 'UD.5.r', 'UD.5.shift', 'DD.shift.r', 'DD.5.shift'], inplace=True, errors='ignore') | ||
df['H.return'] = df['H.l'] | ||
|
||
colsnew = ['H.period', 'DD.period.t', 'UD.period.t', 'H.t', 'DD.t.i', 'UD.t.i', 'H.i', 'DD.i.e', 'UD.i.e', | ||
'H.e', 'DD.e.5', 'UD.e.5', 'H.5', 'DD.5.shift.r', 'UD.5.shift.r', 'H.shift.r', 'DD.shift.r.o', | ||
'UD.shift.r.o', 'H.o', 'DD.o.a', 'UD.o.a', 'H.a', 'DD.a.n', 'UD.a.n', 'H.n', | ||
'DD.n.l', 'UD.n.l', 'H.l', 'DD.l.return', 'UD.l.return', 'H.return' | ||
] | ||
|
||
df = df[colsnew] | ||
|
||
return df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,9 @@ services: | |
FLASK_DEBUG: 1 | ||
volumes: | ||
- .:/api | ||
networks: | ||
- lion | ||
|
||
networks: | ||
lion: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ opencv-python-headless | |
gunicorn | ||
cmake | ||
dlib | ||
face_recognition | ||
face_recognition | ||
pandas | ||
flask-cors |