Yapp99 commited on
Commit
30b9558
·
1 Parent(s): f2ba46f

some small organizations

Browse files
S0_PrepareDataset.py CHANGED
@@ -4,6 +4,7 @@ import tarfile
4
  import requests
5
  from tqdm import tqdm
6
  import os
 
7
  from joblib import Parallel, delayed
8
 
9
  def listdir_full(path: str) -> list[str]:
@@ -26,6 +27,7 @@ def download_file(url, pos):
26
  p_bar.update(len(chunk))
27
  return local_filename
28
 
 
29
  IMAGE_DIR = "data/image"
30
  if not os.path.isdir(IMAGE_DIR):
31
  links = ["http://www.inf.ufpr.br/lesoliveira/download/macroscopic0.zip",
 
4
  import requests
5
  from tqdm import tqdm
6
  import os
7
+ from pathlib import Path
8
  from joblib import Parallel, delayed
9
 
10
  def listdir_full(path: str) -> list[str]:
 
27
  p_bar.update(len(chunk))
28
  return local_filename
29
 
30
+ Path("data").mkdir(exist_ok=True)
31
  IMAGE_DIR = "data/image"
32
  if not os.path.isdir(IMAGE_DIR):
33
  links = ["http://www.inf.ufpr.br/lesoliveira/download/macroscopic0.zip",
S6_Evaluation 2.ipynb CHANGED
@@ -64,7 +64,7 @@
64
  },
65
  {
66
  "cell_type": "code",
67
- "execution_count": 86,
68
  "metadata": {},
69
  "outputs": [
70
  {
@@ -99,7 +99,7 @@
99
  },
100
  {
101
  "cell_type": "code",
102
- "execution_count": 87,
103
  "metadata": {},
104
  "outputs": [],
105
  "source": [
@@ -128,7 +128,7 @@
128
  },
129
  {
130
  "cell_type": "code",
131
- "execution_count": 88,
132
  "metadata": {},
133
  "outputs": [
134
  {
@@ -622,20 +622,9 @@
622
  "40 96 "
623
  ]
624
  },
625
- "execution_count": 88,
626
  "metadata": {},
627
  "output_type": "execute_result"
628
- },
629
- {
630
- "ename": "",
631
- "evalue": "",
632
- "output_type": "error",
633
- "traceback": [
634
- "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
635
- "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
636
- "\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
637
- "\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
638
- ]
639
  }
640
  ],
641
  "source": [
@@ -648,17 +637,9 @@
648
  },
649
  {
650
  "cell_type": "code",
651
- "execution_count": 68,
652
  "metadata": {},
653
- "outputs": [
654
- {
655
- "name": "stderr",
656
- "output_type": "stream",
657
- "text": [
658
- "100%|██████████| 312/312 [01:19<00:00, 3.92it/s]\n"
659
- ]
660
- }
661
- ],
662
  "source": [
663
  "test_loader = DataLoader(TimberDataset(test_df, is_train=True,transform=transform),\n",
664
  " batch_size=12)\n",
@@ -669,7 +650,7 @@
669
  },
670
  {
671
  "cell_type": "code",
672
- "execution_count": 75,
673
  "metadata": {},
674
  "outputs": [
675
  {
@@ -707,16 +688,16 @@
707
  },
708
  {
709
  "cell_type": "code",
710
- "execution_count": 82,
711
  "metadata": {},
712
  "outputs": [
713
  {
714
  "data": {
715
  "text/plain": [
716
- "312"
717
  ]
718
  },
719
- "execution_count": 82,
720
  "metadata": {},
721
  "output_type": "execute_result"
722
  }
@@ -727,7 +708,7 @@
727
  },
728
  {
729
  "cell_type": "code",
730
- "execution_count": 83,
731
  "metadata": {},
732
  "outputs": [],
733
  "source": [
@@ -756,7 +737,7 @@
756
  },
757
  {
758
  "cell_type": "code",
759
- "execution_count": 85,
760
  "metadata": {},
761
  "outputs": [
762
  {
@@ -1250,7 +1231,7 @@
1250
  "40 8 "
1251
  ]
1252
  },
1253
- "execution_count": 85,
1254
  "metadata": {},
1255
  "output_type": "execute_result"
1256
  }
@@ -1259,6 +1240,15 @@
1259
  "zipped = zip(os.listdir(\"data/image/test\"), accuracy, recall, precision, f1s, class_count)\n",
1260
  "pd.DataFrame(zipped, columns=[\"Name\", \"Accuracy\", \"Recall\", \"Precision\", \"F1-Score\", \"N Samples\"])"
1261
  ]
 
 
 
 
 
 
 
 
 
1262
  }
1263
  ],
1264
  "metadata": {
 
64
  },
65
  {
66
  "cell_type": "code",
67
+ "execution_count": 4,
68
  "metadata": {},
69
  "outputs": [
70
  {
 
99
  },
100
  {
101
  "cell_type": "code",
102
+ "execution_count": 5,
103
  "metadata": {},
104
  "outputs": [],
105
  "source": [
 
128
  },
129
  {
130
  "cell_type": "code",
131
+ "execution_count": 6,
132
  "metadata": {},
133
  "outputs": [
134
  {
 
622
  "40 96 "
623
  ]
624
  },
625
+ "execution_count": 6,
626
  "metadata": {},
627
  "output_type": "execute_result"
 
 
 
 
 
 
 
 
 
 
 
628
  }
629
  ],
630
  "source": [
 
637
  },
638
  {
639
  "cell_type": "code",
640
+ "execution_count": 7,
641
  "metadata": {},
642
+ "outputs": [],
 
 
 
 
 
 
 
 
643
  "source": [
644
  "test_loader = DataLoader(TimberDataset(test_df, is_train=True,transform=transform),\n",
645
  " batch_size=12)\n",
 
650
  },
651
  {
652
  "cell_type": "code",
653
+ "execution_count": 8,
654
  "metadata": {},
655
  "outputs": [
656
  {
 
688
  },
689
  {
690
  "cell_type": "code",
691
+ "execution_count": 9,
692
  "metadata": {},
693
  "outputs": [
694
  {
695
  "data": {
696
  "text/plain": [
697
+ "50"
698
  ]
699
  },
700
+ "execution_count": 9,
701
  "metadata": {},
702
  "output_type": "execute_result"
703
  }
 
708
  },
709
  {
710
  "cell_type": "code",
711
+ "execution_count": 10,
712
  "metadata": {},
713
  "outputs": [],
714
  "source": [
 
737
  },
738
  {
739
  "cell_type": "code",
740
+ "execution_count": 11,
741
  "metadata": {},
742
  "outputs": [
743
  {
 
1231
  "40 8 "
1232
  ]
1233
  },
1234
+ "execution_count": 11,
1235
  "metadata": {},
1236
  "output_type": "execute_result"
1237
  }
 
1240
  "zipped = zip(os.listdir(\"data/image/test\"), accuracy, recall, precision, f1s, class_count)\n",
1241
  "pd.DataFrame(zipped, columns=[\"Name\", \"Accuracy\", \"Recall\", \"Precision\", \"F1-Score\", \"N Samples\"])"
1242
  ]
1243
+ },
1244
+ {
1245
+ "cell_type": "code",
1246
+ "execution_count": null,
1247
+ "metadata": {},
1248
+ "outputs": [],
1249
+ "source": [
1250
+ "pd.DataFrame(zipped, columns=[\"Name\", \"Accuracy\", \"Recall\", \"Precision\", \"F1-Score\", \"N Samples\"])"
1251
+ ]
1252
  }
1253
  ],
1254
  "metadata": {
data/annotations.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:64dfe7d6b4be6d3efa7b52c5919eebb8068d53fba555f585b401ece80779db0f
3
- size 81559
 
 
 
 
data/coco.yaml DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:65cc8c22fc16910f500b4dbfa1660dccabad9acc2bab1e670fd379c96a6aad72
3
- size 1310
 
 
 
 
data/dataset.yaml DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:586efc12ccc267f70359b3fb245f93effe57891ca53734fb0f8d9c0c9d32c9b6
3
- size 1258
 
 
 
 
data/timber.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:137eb7516924d5d0c6a3921d54b294e95f506e58c853339d428a810901d5124e
3
- size 1605
 
 
 
 
data/voc.yaml DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f496796f480b640ded3931ed83e499bdf269f96dedbb55272674fb81825a3fdc
3
- size 612