{ "cells": [ { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'video_uid': 'd20f6551-0272-4a69-8b02-da7ffcf29e0f', 'conversation': [{'role': 'user', 'content': 'What should I do next to continue making a recipe after completing the earlier tasks: slice leek, heating a skillet, prepare soapy mixture in a bowl, peel garlic? Please provide clear instructions.', 'time': 434.8484}, {'role': 'assistant', 'content': 'First, add more water to the soapy mixture in the bowl to ensure it’s ready for cleaning.', 'time': 435.57229, 'start_time': 434.8484, 'end_time': 435.57229, 'stamp_time': 435.210345}, {'role': 'assistant', 'content': 'Next, dice the peeled garlic finely for better flavor distribution in your dish.', 'time': 445.22206, 'start_time': 435.57229, 'end_time': 445.22206, 'stamp_time': 440.397175}, {'role': 'assistant', 'content': 'Take a moment to check the recipe in the manual to confirm the next steps.', 'time': 839.977, 'start_time': 449.299, 'end_time': 839.977, 'stamp_time': 644.6379999999999}, {'role': 'assistant', 'content': 'Before proceeding, wash your hands thoroughly to maintain hygiene.', 'time': 860.10599, 'start_time': 840.78309, 'end_time': 860.10599, 'stamp_time': 850.44454}, {'role': 'assistant', 'content': 'Now, prepare the stock that will be used as a base for your soup.', 'time': 875.37843, 'start_time': 860.42941, 'end_time': 875.37843, 'stamp_time': 867.90392}, {'role': 'assistant', 'content': 'Add the prepared stock to the sliced leek in the skillet to start cooking the soup.', 'time': 987.484, 'start_time': 875.74605, 'end_time': 987.484, 'stamp_time': 931.6150250000001}, {'role': 'assistant', 'content': 'Clear the countertop to create more workspace and keep the area tidy.', 'time': 996.95592, 'start_time': 988.81578, 'end_time': 996.95592, 'stamp_time': 992.88585}, {'role': 'assistant', 'content': 'Wash the knife in the soapy mixture to clean it after use.', 'time': 1033.83901, 'start_time': 1006.96205, 'end_time': 1033.83901, 'stamp_time': 1020.4005299999999}, {'role': 'assistant', 'content': 'Arrange the plates into the cupboard to keep them ready for serving.', 'time': 1088.19204, 'start_time': 1068.89759, 'end_time': 1088.19204, 'stamp_time': 1078.544815}, {'role': 'assistant', 'content': 'Wash the kitchen utensils in the soapy mixture to ensure they’re clean and ready for use.', 'time': 1108.97613, 'start_time': 1095.386, 'end_time': 1108.97613, 'stamp_time': 1102.181065}, {'role': 'assistant', 'content': 'Finally, stir the potato leek soup in the skillet to combine all the ingredients evenly.', 'time': 1289.00491, 'start_time': 1109.72215, 'end_time': 1289.00491, 'stamp_time': 1199.36353}], 'duration': 867.9392953125, 'start_time': 434.8484, 'end_time': 1302.7876953125, 'Task Type': 'Action Reasoning', 'evaluator_output_text': [[], [], [], [], [], [], [], [], [], [], []], 'evaluator_output_reponse': [[], [], [], [], [], [], [], [], [], [], []]}\n", "{'video_uid': 'grp-a9c519a7-4776-42d6-bcf1-270f0d302843', 'conversation': [{'role': 'user', 'content': 'What is the next thing I need to do to make pancakes after the steps already completed: gathers utensils on countertop, pours flour in bowl, stores flour in cabinet, removes ingredients from fridge, prepares flour mixture in bowl, turns on cooking gas, prepares flour mixture in bowl, inspects flour pack, heats butter in pan, prepares pancake in pan? Include any important details.', 'time': 381.307}, {'role': 'assistant', 'content': 'Next, fetch water in a bowl to add to your pancake mixture. This will help achieve the right consistency for the batter.', 'time': 382.23681, 'start_time': 381.307, 'end_time': 382.23681, 'stamp_time': 381.771905}, {'role': 'assistant', 'content': 'Now, inspect the pancake in the pan to ensure it’s cooking evenly and not burning. Adjust the heat if necessary.', 'time': 391.83298, 'start_time': 382.23681, 'end_time': 391.83298, 'stamp_time': 387.034895}, {'role': 'assistant', 'content': 'Remove any sauce or toppings from the fridge that you plan to serve with the pancakes.', 'time': 413.87677999999994, 'start_time': 393.33784, 'end_time': 413.87677999999994, 'stamp_time': 403.60731}, {'role': 'assistant', 'content': 'Declutter the kitchen countertop to create more space for plating and serving the pancakes.', 'time': 422.56539499999997, 'start_time': 414.07678, 'end_time': 422.56539499999997, 'stamp_time': 418.3210875}, {'role': 'assistant', 'content': 'Inspect the pancake in the pan again to check if it’s ready to flip or remove from the heat.', 'time': 446.946, 'start_time': 422.765395, 'end_time': 446.946, 'stamp_time': 434.8556975}, {'role': 'assistant', 'content': 'Clean a plate with a cloth to ensure it’s ready for serving the pancakes.', 'time': 503.40671499999996, 'start_time': 447.71982, 'end_time': 503.40671499999996, 'stamp_time': 475.5632675}, {'role': 'assistant', 'content': 'Prepare the next pancake in the pan, ensuring the batter is evenly spread for consistent cooking.', 'time': 508.35909, 'start_time': 503.606715, 'end_time': 508.35909, 'stamp_time': 505.9829025}, {'role': 'assistant', 'content': 'Wash any used utensils in the sink to keep your workspace clean and organized.', 'time': 592.967, 'start_time': 509.93854, 'end_time': 592.967, 'stamp_time': 551.45277}, {'role': 'assistant', 'content': 'Clean another plate with a cloth if needed, ensuring all serving dishes are ready.', 'time': 651.607, 'start_time': 592.96796, 'end_time': 651.607, 'stamp_time': 622.28748}, {'role': 'assistant', 'content': 'Prepare the next pancake in the pan, maintaining a steady heat for even cooking.', 'time': 659.0125, 'start_time': 654.49488, 'end_time': 659.0125, 'stamp_time': 656.75369}, {'role': 'assistant', 'content': 'Serve the pancake on a plate, arranging it neatly for presentation.', 'time': 742.45, 'start_time': 663.88021, 'end_time': 742.45, 'stamp_time': 703.165105}, {'role': 'assistant', 'content': 'Turn off the cooking gas to ensure safety once all pancakes are prepared.', 'time': 749.7833850000001, 'start_time': 742.5897, 'end_time': 749.7833850000001, 'stamp_time': 746.1865425000001}, {'role': 'assistant', 'content': 'Prepare the final pancake on the plate, adding any toppings or sauces as desired.', 'time': 752.07794, 'start_time': 749.9833850000001, 'end_time': 752.07794, 'stamp_time': 751.0306625000001}, {'role': 'assistant', 'content': 'Store any unused ingredients back in the fridge to keep them fresh for later use.', 'time': 855.817, 'start_time': 761.51526, 'end_time': 855.817, 'stamp_time': 808.6661300000001}, {'role': 'assistant', 'content': 'Cover the pancake with a lid to keep it warm while you finish up other tasks.', 'time': 869.93716, 'start_time': 857.18827, 'end_time': 869.93716, 'stamp_time': 863.562715}, {'role': 'assistant', 'content': 'Declutter the kitchen countertop once more to ensure a clean and tidy workspace.', 'time': 885.138505, 'start_time': 881.68724, 'end_time': 885.138505, 'stamp_time': 883.4128725}, {'role': 'assistant', 'content': 'Check the pancake on the plate to ensure it’s ready to serve and looks appetizing.', 'time': 1196.997, 'start_time': 885.338505, 'end_time': 1196.997, 'stamp_time': 1041.1677525}], 'duration': 831.6016588541665, 'start_time': 381.307, 'end_time': 1212.9086588541666, 'Task Type': 'Action Reasoning', 'evaluator_output_text': [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'evaluator_output_reponse': [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]}\n", "{'video_uid': 'eb1b6e62-7197-4a75-bc39-c373e558fd97', 'conversation': [{'role': 'user', 'content': 'What are the sequential actions I need to take to accomplish my goal, like making dough balls?', 'time': 0.0}, {'role': 'assistant', 'content': 'To start, shape the dough into a ball by gently rolling it between your hands.', 'time': 29.20309, 'start_time': 0.0, 'end_time': 29.20309, 'stamp_time': 14.601545}, {'role': 'assistant', 'content': 'Continue shaping the dough into a smooth, round ball to ensure even cooking and texture.', 'time': 671.09652, 'start_time': 29.20309, 'end_time': 671.09652, 'stamp_time': 350.149805}], 'duration': 848.4666666666667, 'start_time': 0.0, 'end_time': 848.4666666666667, 'Task Type': 'Task Understanding', 'evaluator_output_text': [[], []], 'evaluator_output_reponse': [[], []]}\n", "1212\n", "1212\n" ] } ], "source": [ "import json,os\n", "import numpy as np\n", "\n", "def load_multiple_json(file_path):\n", " \"\"\"读取包含多个 JSON 对象的文件,并将每个 JSON 对象解析成 Python 对象,存放在列表中。\"\"\"\n", " with open(file_path, 'r', encoding='utf-8') as f:\n", " content = f.read()\n", " \n", " decoder = json.JSONDecoder()\n", " pos = 0\n", " results = []\n", " content_length = len(content)\n", " \n", " while pos < content_length:\n", " # 跳过空白字符\n", " while pos < content_length and content[pos].isspace():\n", " pos += 1\n", " if pos >= content_length:\n", " break\n", " try:\n", " obj, new_pos = decoder.raw_decode(content, pos)\n", " results.append(obj)\n", " pos = new_pos\n", " except json.JSONDecodeError as e:\n", " # 出现解析错误则退出循环\n", " print(f\"JSON 解析错误: {e}\")\n", " break\n", " return results\n", "\n", "\n", "eval_file1 = '/root/videollm-online/data/estp_dataset/result/estpBenchSq_fbf_EWOInDomainITstage2evaluator_llama_5_5.json'\n", "\n", "parent_dir = os.path.dirname(eval_file1)\n", "eval_files = [os.path.join(parent_dir, f) for f in os.listdir(parent_dir) if f.startswith(eval_file1.split('/')[-1])]\n", "eval_result1 = []\n", "for eval_file in eval_files:\n", " eval_result1 += load_multiple_json(eval_file)\n", " \n", " \n", "eval_file2 = '/root/videollm-online/data/estp_dataset/result/estp_bench_sq_VideollmOnlineevaluator_llama_5_5.json'\n", "\n", "parent_dir = os.path.dirname(eval_file2)\n", "eval_files = [os.path.join(parent_dir, f) for f in os.listdir(parent_dir) if f.startswith(eval_file2.split('/')[-1])]\n", "eval_result2 = []\n", "for eval_file in eval_files:\n", " eval_result2 += load_multiple_json(eval_file)\n", " \n", "for result in eval_result1:\n", " if 'EWO' not in result:\n", " print(result)\n", "print(len(eval_result1))\n", "print(len(eval_result2))\n" ] } ], "metadata": { "kernelspec": { "display_name": "videollm", "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.10.14" } }, "nbformat": 4, "nbformat_minor": 2 }