diff --git a/tools/stratifiedgroupkfold.ipynb b/tools/stratifiedgroupkfold.ipynb index 1895426..aa0bf5d 100644 --- a/tools/stratifiedgroupkfold.ipynb +++ b/tools/stratifiedgroupkfold.ipynb @@ -15,15 +15,20 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ + "# annotation file\n", + "annotation = '/data/ephemeral/home/relabeled_general_trash_json/train_relabeled_class_20.json'\n", + "\n", "# data annotation file 저장 경로\n", - "save_annotation_path = '/data/ephemeral/home/dataset'\n", + "save_folder = annotation.split(\"/\")[-1].split(\".\")[0]\n", + "save_annotation_path = f'/data/ephemeral/home/dataset/{save_folder}_k_fold'\n", "\n", - "# annotation file\n", - "annotation = '/data/ephemeral/home/dataset/train.json'\n", + "# 저장 경로에 폴더가 없으면 생성\n", + "if not os.path.exists(save_annotation_path):\n", + " os.makedirs(save_annotation_path)\n", "\n", "with open(annotation) as f:\n", " data = json.load(f)\n", @@ -36,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -57,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ {