File size: 1,781 Bytes
fb5d697 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# investigate easycom transcript\n",
"# transcript jisoo gaved me is not align what I got\n",
"# I want to know whether there are overlap or not"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/junhyeok/projects/turn-taking-dataset/notebooks\n",
"27582\n",
"6895\n"
]
}
],
"source": [
"import json\n",
"import os\n",
"import numpy as np\n",
"\n",
"print(os.getcwd())\n",
"ts_dir = '../mmaction2/data/EasyComDataset_fix/Main/Speech_Transcriptions/val/Session_1/'\n",
"\n",
"ts_list = os.listdir(ts_dir)\n",
"ts_list.sort()\n",
"\n",
"sum_end_frame = 0\n",
"\n",
"for ts_path in ts_list:\n",
" with open(os.path.join(ts_dir, ts_path), 'r') as f:\n",
" ts = json.load(f)\n",
" \n",
" max_end_frame = 0\n",
" for utt in ts:\n",
" if utt['End_Frame'] > max_end_frame:\n",
" max_end_frame = utt['End_Frame']\n",
" \n",
" sum_end_frame += max_end_frame\n",
"\n",
"print(sum_end_frame)\n",
"print(sum_end_frame//4)\n",
" \n",
" \n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ttd",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|