mingyang91 commited on
Commit
0821896
1 Parent(s): 6ff6007

filter out macos cache files

Browse files
Files changed (3) hide show
  1. .idea/workspace.xml +22 -3
  2. demo.py +1 -1
  3. yolo_dataset.py +4 -4
.idea/workspace.xml CHANGED
@@ -6,6 +6,7 @@
6
  <component name="ChangeListManager">
7
  <list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="fix runtime error in coco evaluator">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
 
9
  <change beforePath="$PROJECT_DIR$/yolo_dataset.py" beforeDir="false" afterPath="$PROJECT_DIR$/yolo_dataset.py" afterDir="false" />
10
  </list>
11
  <option name="SHOW_DIALOG" value="false" />
@@ -238,7 +239,7 @@
238
  <workItem from="1706274709532" duration="27000" />
239
  <workItem from="1706445222599" duration="1814000" />
240
  <workItem from="1706449264770" duration="4974000" />
241
- <workItem from="1706517295469" duration="574000" />
242
  </task>
243
  <task id="LOCAL-00001" summary="init commit">
244
  <option name="closed" value="true" />
@@ -464,7 +465,15 @@
464
  <option name="project" value="LOCAL" />
465
  <updated>1706454211376</updated>
466
  </task>
467
- <option name="localTasksCounter" value="29" />
 
 
 
 
 
 
 
 
468
  <servers />
469
  </component>
470
  <component name="TypeScriptGeneratedFilesManager">
@@ -519,6 +528,16 @@
519
  <line>77</line>
520
  <option name="timeStamp" value="17" />
521
  </line-breakpoint>
 
 
 
 
 
 
 
 
 
 
522
  </breakpoints>
523
  </breakpoint-manager>
524
  </component>
@@ -526,7 +545,7 @@
526
  <SUITE FILE_PATH="coverage/detector$yolo_dataset.coverage" NAME="yolo_dataset Coverage Results" MODIFIED="1705852113469" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
527
  <SUITE FILE_PATH="coverage/detector$evaluator.coverage" NAME="evaluator Coverage Results" MODIFIED="1706107083258" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
528
  <SUITE FILE_PATH="coverage/detector$demo.coverage" NAME="demo Coverage Results" MODIFIED="1706108414052" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
529
- <SUITE FILE_PATH="coverage/detector$streamlit.coverage" NAME="streamlit Coverage Results" MODIFIED="1706517471264" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
530
  <SUITE FILE_PATH="coverage/detector$extract.coverage" NAME="yolo_dataset Coverage Results" MODIFIED="1705764465837" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
531
  </component>
532
  </project>
 
6
  <component name="ChangeListManager">
7
  <list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="fix runtime error in coco evaluator">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/demo.py" beforeDir="false" afterPath="$PROJECT_DIR$/demo.py" afterDir="false" />
10
  <change beforePath="$PROJECT_DIR$/yolo_dataset.py" beforeDir="false" afterPath="$PROJECT_DIR$/yolo_dataset.py" afterDir="false" />
11
  </list>
12
  <option name="SHOW_DIALOG" value="false" />
 
239
  <workItem from="1706274709532" duration="27000" />
240
  <workItem from="1706445222599" duration="1814000" />
241
  <workItem from="1706449264770" duration="4974000" />
242
+ <workItem from="1706517295469" duration="1726000" />
243
  </task>
244
  <task id="LOCAL-00001" summary="init commit">
245
  <option name="closed" value="true" />
 
465
  <option name="project" value="LOCAL" />
466
  <updated>1706454211376</updated>
467
  </task>
468
+ <task id="LOCAL-00029" summary="fix runtime error in coco evaluator">
469
+ <option name="closed" value="true" />
470
+ <created>1706517885858</created>
471
+ <option name="number" value="00029" />
472
+ <option name="presentableId" value="LOCAL-00029" />
473
+ <option name="project" value="LOCAL" />
474
+ <updated>1706517885858</updated>
475
+ </task>
476
+ <option name="localTasksCounter" value="30" />
477
  <servers />
478
  </component>
479
  <component name="TypeScriptGeneratedFilesManager">
 
528
  <line>77</line>
529
  <option name="timeStamp" value="17" />
530
  </line-breakpoint>
531
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
532
+ <url>file://$PROJECT_DIR$/yolo_dataset.py</url>
533
+ <line>239</line>
534
+ <option name="timeStamp" value="20" />
535
+ </line-breakpoint>
536
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
537
+ <url>file://$PROJECT_DIR$/yolo_dataset.py</url>
538
+ <line>229</line>
539
+ <option name="timeStamp" value="21" />
540
+ </line-breakpoint>
541
  </breakpoints>
542
  </breakpoint-manager>
543
  </component>
 
545
  <SUITE FILE_PATH="coverage/detector$yolo_dataset.coverage" NAME="yolo_dataset Coverage Results" MODIFIED="1705852113469" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
546
  <SUITE FILE_PATH="coverage/detector$evaluator.coverage" NAME="evaluator Coverage Results" MODIFIED="1706107083258" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
547
  <SUITE FILE_PATH="coverage/detector$demo.coverage" NAME="demo Coverage Results" MODIFIED="1706108414052" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
548
+ <SUITE FILE_PATH="coverage/detector$streamlit.coverage" NAME="streamlit Coverage Results" MODIFIED="1706518941359" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
549
  <SUITE FILE_PATH="coverage/detector$extract.coverage" NAME="yolo_dataset Coverage Results" MODIFIED="1705764465837" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
550
  </component>
551
  </project>
demo.py CHANGED
@@ -25,7 +25,7 @@ def main():
25
 
26
  model = None
27
  with st.sidebar:
28
- model_choice = st.radio("Select Model", ["Fire&Smoke", "Crack", "Coco"])
29
  if model_choice == "Fire&Smoke":
30
  model = fire_and_smoke
31
  elif model_choice == "Crack":
 
25
 
26
  model = None
27
  with st.sidebar:
28
+ model_choice = st.radio("Select Model", ["Fire&Smoke", "Crack"])
29
  if model_choice == "Fire&Smoke":
30
  model = fire_and_smoke
31
  elif model_choice == "Crack":
yolo_dataset.py CHANGED
@@ -127,7 +127,7 @@ class YoloDataset:
127
  @staticmethod
128
  def from_zip_file(zip_file: ZipFile) -> 'YoloDataset':
129
  namelist = zip_file.namelist()
130
- namelist = list(filter(lambda x: not x.startswith('.DS_Store'), namelist))
131
  root_name = namelist[0]
132
  if not zip_file.getinfo(root_name).is_dir():
133
  root_name = root_name.split('/')[0] + '/'
@@ -228,7 +228,7 @@ class MaterialYoloDataset:
228
  self._zip_file = dataset.zip_file
229
  first = self._zip_file.namelist()[0]
230
  if self._zip_file.getinfo(first).is_dir():
231
- self._root = first[-1]
232
  else:
233
  self._root = first.split('/')[0]
234
 
@@ -239,8 +239,8 @@ class MaterialYoloDataset:
239
  self._zip_file.extractall(f'./datasets/')
240
  with open(f'./datasets/{self._root}/data.yaml', 'w+') as f:
241
  f.write(f'path: {dataset_path.absolute()}/{self._root}/\n')
242
- f.write(f'train: images/train\n')
243
- f.write(f'val: images/val\n')
244
  f.write(f'\n')
245
  f.write(f'# Classes\n')
246
  f.write(f'names:\n')
 
127
  @staticmethod
128
  def from_zip_file(zip_file: ZipFile) -> 'YoloDataset':
129
  namelist = zip_file.namelist()
130
+ namelist = list(filter(lambda x: not (x.endswith('.DS_Store') or x.startswith('__MACOSX')), namelist))
131
  root_name = namelist[0]
132
  if not zip_file.getinfo(root_name).is_dir():
133
  root_name = root_name.split('/')[0] + '/'
 
228
  self._zip_file = dataset.zip_file
229
  first = self._zip_file.namelist()[0]
230
  if self._zip_file.getinfo(first).is_dir():
231
+ self._root = first[0:-1]
232
  else:
233
  self._root = first.split('/')[0]
234
 
 
239
  self._zip_file.extractall(f'./datasets/')
240
  with open(f'./datasets/{self._root}/data.yaml', 'w+') as f:
241
  f.write(f'path: {dataset_path.absolute()}/{self._root}/\n')
242
+ f.write(f'train: images\n')
243
+ f.write(f'val: images\n')
244
  f.write(f'\n')
245
  f.write(f'# Classes\n')
246
  f.write(f'names:\n')