diff --git a/dashboard/.gitignore b/dashboard/.gitignore index 4d29575d..7aec64a9 100644 --- a/dashboard/.gitignore +++ b/dashboard/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +/flask-server/__pycache__ \ No newline at end of file diff --git a/dashboard/flask-server/__pycache__/process_input_data.cpython-39.pyc b/dashboard/flask-server/__pycache__/process_input_data.cpython-39.pyc index 581c068a..408bdac4 100644 Binary files a/dashboard/flask-server/__pycache__/process_input_data.cpython-39.pyc and b/dashboard/flask-server/__pycache__/process_input_data.cpython-39.pyc differ diff --git a/dashboard/flask-server/process_input_data.py b/dashboard/flask-server/process_input_data.py index dea98507..ed1798df 100644 --- a/dashboard/flask-server/process_input_data.py +++ b/dashboard/flask-server/process_input_data.py @@ -41,6 +41,7 @@ def read_rawFacialDf(ar, id): facial_asym_filename = ar + "/raw_variables/"+id+"/facial/face_asymmetry/"+id+"_facasym.csv" facial_au_filename = ar + "/raw_variables/"+id+"/facial/face_au/"+id+"_facau.csv" facial_expr_filename = ar + "/raw_variables/"+id+"/facial/face_expressivity/"+id+"_facemo.csv" + landmark_filename = ar + "/raw_variables/"+id+"/facial/face_landmark/"+id+"_faclmk.csv" if not exists(facial_asym_filename) or not exists(facial_au_filename) or not exists(facial_expr_filename): return pd.DataFrame() @@ -51,7 +52,6 @@ def read_rawFacialDf(ar, id): facial_au = pd.read_csv(facial_au_filename) facial_au_cols = [col for col in facial_au if col not in skip_cols] - facial_expr = pd.read_csv(facial_expr_filename) facial_expr_cols = [col for col in facial_expr if col not in skip_cols and "AU" not in col] @@ -70,6 +70,10 @@ def read_rawMovementDf(ar, id): gaze_filename = ar + "/raw_variables/"+id+"/movement/gaze/"+id+"_eyegaze.csv" head_movement_filename = ar + "/raw_variables/"+id+"/movement/head_movement/"+id+"_headmov.csv" head_pose_filename = ar + "/raw_variables/"+id+"/movement/head_pose/"+id+"_headpose.csv" + + blinks_filename = ar + "/raw_variables/"+id+"/movement/eye_blink/"+id+"_eyeblinks.csv" + fac_tremor_filename = ar + "/raw_variables/"+id+"/movement/facial_tremor/"+id+"_fac_tremor.csv" + voice_tremor_filename = ar + "/raw_variables/"+id+"/movement/voice_tremor/"+id+"_vtremor.csv" if not exists(gaze_filename) or not exists(head_movement_filename) or not exists(head_pose_filename): return pd.DataFrame() @@ -81,6 +85,16 @@ def read_rawMovementDf(ar, id): head_movement_cols = [col for col in head_movement if col not in skip_cols] + # blinks = pd.read_csv(blinks_filename) + # blinks_cols = [col for col in blinks if col not in skip_cols] + + # fac_tremor = pd.read_csv(fac_tremor_filename) + # fac_tremor_cols = [col for col in fac_tremor if col not in skip_cols] + + voice_tremor = pd.read_csv(voice_tremor_filename) + voice_tremor_cols = [col for col in voice_tremor if col not in skip_cols] + + head_pose = pd.read_csv(head_pose_filename) head_pose_cols = [col for col in head_pose if col not in skip_cols] @@ -89,8 +103,12 @@ def read_rawMovementDf(ar, id): movement_df[el] = head_movement[el] for el in gaze_cols: movement_df[el] = gaze[el] - - + # for el in blinks_cols: + # movement_df[el] = blinks[el] + # for el in fac_tremor_cols: + # movement_df[el] = fac_tremor[el] + for el in voice_tremor_cols: + movement_df[el] = voice_tremor[el] return movement_df.fillna(0) @@ -104,6 +122,12 @@ def read_rawAcousticDf(ar, id): intt_filename = ar + "/raw_variables/"+id+"/acoustic/intensity/"+id+"_intensity.csv" mfcc_filename = ar + "/raw_variables/"+id+"/acoustic/mfcc/"+id+"_mfcc.csv" pitch_filename = ar + "/raw_variables/"+id+"/acoustic/pitch/"+id+"_pitch.csv" + jitter_filename = ar + "/raw_variables/"+id+"/acoustic/jitter/"+id+"_jitter.csv" + pause_segment_filename = ar + "/raw_variables/"+id+"/acoustic/pause_segment/"+id+"_pausechar.csv" + shimmer_filename = ar + "/raw_variables/"+id+"/acoustic/shimmer/"+id+"_shimmer.csv" + voice_frame_score_filename = ar + "/raw_variables/"+id+"/acoustic/voice_frame_score/"+id+"_voiceprev.csv" + + filename_list = [fm_filename, gne_filename, hnr_filename, intt_filename,mfcc_filename, pitch_filename, pause_segment_filename, shimmer_filename, voice_frame_score_filename] if not exists(fm_filename) or not exists(gne_filename) or not exists(hnr_filename) or not exists(intt_filename) or not exists(mfcc_filename) or not exists(pitch_filename): return pd.DataFrame @@ -129,6 +153,18 @@ def read_rawAcousticDf(ar, id): pitch = pd.read_csv(pitch_filename) pitch_cols = [col for col in pitch if col not in skip_cols] + pause_segment = pd.read_csv(pause_segment_filename) + pause_segment_cols = [col for col in pause_segment if col not in skip_cols] + + jitter = pd.read_csv(jitter_filename) + jitter_cols = [col for col in jitter if col not in skip_cols] + + shimmer = pd.read_csv(shimmer_filename) + shimmer_cols = [col for col in shimmer if col not in skip_cols] + + voice_frame_score = pd.read_csv(voice_frame_score_filename) + voice_frame_score_cols = [col for col in voice_frame_score if col not in skip_cols] + acoustic_df = fm.loc[:, ~fm.columns.isin(skip_cols)].copy() for el in gne_cols: acoustic_df[el] = gne[el] @@ -140,6 +176,14 @@ def read_rawAcousticDf(ar, id): acoustic_df[el] = mfcc[el] for el in pitch_cols: acoustic_df[el] = pitch[el] + for el in pause_segment_cols: + acoustic_df[el] = pause_segment[el] + for el in jitter_cols: + acoustic_df[el] = jitter[el] + for el in shimmer_cols: + acoustic_df[el] = shimmer[el] + for el in voice_frame_score_cols: + acoustic_df[el] = voice_frame_score[el] return acoustic_df.fillna(0) diff --git a/dashboard/flask-server/server.py b/dashboard/flask-server/server.py index 28615a1b..dd1d190e 100644 --- a/dashboard/flask-server/server.py +++ b/dashboard/flask-server/server.py @@ -111,15 +111,15 @@ def fetchIndividualFacialTimelineData(): def getRawAttributesAndIds(): result = {} if not individualFacialRawData.empty: - result['facial'] = [x for x in list(individualFacialRawData.columns) if x not in ["frame"]] + result['facial'] = [x for x in list(individualFacialRawData.columns)] else: result['facial'] =[] if not individualAcousticRawData.empty: - result['acoustic'] = [x for x in list(individualAcousticRawData.columns) if x not in ["Frames"]] + result['acoustic'] = [x for x in list(individualAcousticRawData.columns)] else: result['acoustic'] = [] if not individualMovementRawData.empty: - result['movement'] = [x for x in list(individualMovementRawData.columns) if x not in ["Frames"]] + result['movement'] = [x for x in list(individualMovementRawData.columns)] else: result['movement'] = [] if len(rawDataArgs) > 0: @@ -151,77 +151,68 @@ def individualCorrMatrixData(id): all_df = f.copy() if len(f) == len(m): for x in m.columns: - if x not in ['Frames', 'frame']: - all_df[x] = m[x] + all_df[x] = m[x] else: seg = int(len(m)/(max(len(f),1))) reminder = len(m)%(max(len(f),1)) for i, row in all_df.iterrows(): for x in m.columns: - if x not in ['Frames', 'frame']: - if i len(f): seg = int(len(a)/(max(len(f),1))) reminder = len(a)%(max(len(f),1)) for i, row in all_df.iterrows(): for x in a.columns: - if x not in ['Frames', 'frame']: - if i len(m): seg = int(len(a)/(max(len(m),1))) reminder = len(a)%(max(len(m),1)) for i, row in all_df.iterrows(): for x in a.columns: - if x not in ['Frames', 'frame']: - if i { attrDict[e] = metadataColorList[i + 1] }) - if(data.length > 0) - data.forEach(e => { - if (e['attr']) { - metaColorData[e['id']] = attrDict[e['attr']] - } - }) + if (data.length > 0) + data.forEach(e => { + if (e['attr']) { + metaColorData[e['id']] = attrDict[e['attr']] + } + }) } setMetadataAttrColor(metaColorData) } @@ -210,7 +210,6 @@ function CohortPanel() { ).then( data => { setCorrMatrixData(data) - setCorrMatrixArgs(corrMatrix_args) } ) } @@ -231,7 +230,10 @@ function CohortPanel() { const handleIdCheckboxChange = ev => { $('#' + ev.target.id).is(":checked") ? $(".dot_" + ev.target.id.replace("_id", "")).css("fill", "red") : - $(".dot_" + ev.target.id.replace("_id", "")).css("fill", (Object.keys(metadataAttrColor).includes(ev.target.id.replace("_id", "")) & metadataButton) ? metadataAttrColor[ev.target.id.replace("_id", "")] : "#69b3a2") + $(".dot_" + ev.target.id.replace("_id", "")).css("fill", + (Object.keys(metadataAttrColor).includes(ev.target.id.replace("_id", "")) & + metadataButton) ? metadataAttrColor[ev.target.id.replace("_id", "")] : "#69b3a2") + var filteredIdData_aux = idData.filter(id => $('#' + id + "_id").is(":checked")) setFilteredIdData(filteredIdData_aux) @@ -259,79 +261,71 @@ function CohortPanel() { const handleUnselectCheckboxes = () => { const updatedCheckboxes = checkedCorrMatrixState.map(e => false) - if (distrButton) { - setCheckedDistrState(updatedCheckboxes) - } - else if (pcaButton) { - setCheckedPCAState(updatedCheckboxes) - } - else { - setCheckedCorrMatrixState(updatedCheckboxes) - } + if (distrButton) setCheckedDistrState(updatedCheckboxes) + else if (pcaButton) setCheckedPCAState(updatedCheckboxes) + else setCheckedCorrMatrixState(updatedCheckboxes) } return (
{metadata && metadata.length > 0 && -
+
-
-
Attributes:
+
+
Attributes:
{metadataColorList.map((value, index) => -
- - +
+ -
{value === "none" ? "None" : ""}
)}
} - {allDBMArg.length > 0 && - - -
+ + +
-
+
{pcaButton && -
-
+
+
-
+
} {distrButton && -
-
+
+
-
+
} {corrMatrixButton && -
-
+
+
-
+
@@ -339,22 +333,20 @@ function CohortPanel() { }
- - + + {pcaCoords && } - - + + - + - -
+ +
{idData.map((value, index) =>