Spaces:
Runtime error
Runtime error
mingyang91
commited on
Update UI
Browse files- .idea/workspace.xml +23 -5
- yolo_dataset.py +8 -1
.idea/workspace.xml
CHANGED
@@ -6,8 +6,7 @@
|
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="Update UI">
|
8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
9 |
-
<change beforePath="$PROJECT_DIR$/
|
10 |
-
<change beforePath="$PROJECT_DIR$/evaluator.py" beforeDir="false" afterPath="$PROJECT_DIR$/evaluator.py" afterDir="false" />
|
11 |
</list>
|
12 |
<option name="SHOW_DIALOG" value="false" />
|
13 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
@@ -233,7 +232,8 @@
|
|
233 |
<workItem from="1705812482464" duration="711000" />
|
234 |
<workItem from="1705845330999" duration="11089000" />
|
235 |
<workItem from="1706104589422" duration="517000" />
|
236 |
-
<workItem from="1706105118954" duration="
|
|
|
237 |
</task>
|
238 |
<task id="LOCAL-00001" summary="init commit">
|
239 |
<option name="closed" value="true" />
|
@@ -427,7 +427,15 @@
|
|
427 |
<option name="project" value="LOCAL" />
|
428 |
<updated>1706108912066</updated>
|
429 |
</task>
|
430 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
<servers />
|
432 |
</component>
|
433 |
<component name="TypeScriptGeneratedFilesManager">
|
@@ -486,6 +494,16 @@
|
|
486 |
<line>81</line>
|
487 |
<option name="timeStamp" value="17" />
|
488 |
</line-breakpoint>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
</breakpoints>
|
490 |
</breakpoint-manager>
|
491 |
</component>
|
@@ -493,7 +511,7 @@
|
|
493 |
<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$" />
|
494 |
<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$" />
|
495 |
<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$" />
|
496 |
-
<SUITE FILE_PATH="coverage/detector$streamlit.coverage" NAME="streamlit Coverage Results" MODIFIED="
|
497 |
<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$" />
|
498 |
</component>
|
499 |
</project>
|
|
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="Update UI">
|
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" />
|
12 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
|
232 |
<workItem from="1705812482464" duration="711000" />
|
233 |
<workItem from="1705845330999" duration="11089000" />
|
234 |
<workItem from="1706104589422" duration="517000" />
|
235 |
+
<workItem from="1706105118954" duration="5729000" />
|
236 |
+
<workItem from="1706151430872" duration="786000" />
|
237 |
</task>
|
238 |
<task id="LOCAL-00001" summary="init commit">
|
239 |
<option name="closed" value="true" />
|
|
|
427 |
<option name="project" value="LOCAL" />
|
428 |
<updated>1706108912066</updated>
|
429 |
</task>
|
430 |
+
<task id="LOCAL-00025" summary="Update UI">
|
431 |
+
<option name="closed" value="true" />
|
432 |
+
<created>1706110517589</created>
|
433 |
+
<option name="number" value="00025" />
|
434 |
+
<option name="presentableId" value="LOCAL-00025" />
|
435 |
+
<option name="project" value="LOCAL" />
|
436 |
+
<updated>1706110517589</updated>
|
437 |
+
</task>
|
438 |
+
<option name="localTasksCounter" value="26" />
|
439 |
<servers />
|
440 |
</component>
|
441 |
<component name="TypeScriptGeneratedFilesManager">
|
|
|
494 |
<line>81</line>
|
495 |
<option name="timeStamp" value="17" />
|
496 |
</line-breakpoint>
|
497 |
+
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
498 |
+
<url>file://$PROJECT_DIR$/yolo_dataset.py</url>
|
499 |
+
<line>230</line>
|
500 |
+
<option name="timeStamp" value="20" />
|
501 |
+
</line-breakpoint>
|
502 |
+
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
503 |
+
<url>file://$PROJECT_DIR$/yolo_dataset.py</url>
|
504 |
+
<line>233</line>
|
505 |
+
<option name="timeStamp" value="21" />
|
506 |
+
</line-breakpoint>
|
507 |
</breakpoints>
|
508 |
</breakpoint-manager>
|
509 |
</component>
|
|
|
511 |
<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$" />
|
512 |
<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$" />
|
513 |
<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$" />
|
514 |
+
<SUITE FILE_PATH="coverage/detector$streamlit.coverage" NAME="streamlit Coverage Results" MODIFIED="1706152216466" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
515 |
<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$" />
|
516 |
</component>
|
517 |
</project>
|
yolo_dataset.py
CHANGED
@@ -123,6 +123,9 @@ class YoloDataset:
|
|
123 |
def from_zip_file(zip_file: ZipFile) -> 'YoloDataset':
|
124 |
namelist = zip_file.namelist()
|
125 |
root_name = namelist[0]
|
|
|
|
|
|
|
126 |
namelist = list(filter(lambda x: not zip_file.getinfo(x).is_dir(), namelist))
|
127 |
cls_filename = root_name + 'classes.txt'
|
128 |
if cls_filename in namelist:
|
@@ -217,7 +220,11 @@ class MaterialYoloDataset:
|
|
217 |
print(dataset.to_coco().cats)
|
218 |
self._classes = dataset.classes
|
219 |
self._zip_file = dataset.zip_file
|
220 |
-
|
|
|
|
|
|
|
|
|
221 |
|
222 |
def __enter__(self):
|
223 |
# recursively create dir
|
|
|
123 |
def from_zip_file(zip_file: ZipFile) -> 'YoloDataset':
|
124 |
namelist = zip_file.namelist()
|
125 |
root_name = namelist[0]
|
126 |
+
if not zip_file.getinfo(root_name).is_dir():
|
127 |
+
root_name = root_name.split('/')[0] + '/'
|
128 |
+
|
129 |
namelist = list(filter(lambda x: not zip_file.getinfo(x).is_dir(), namelist))
|
130 |
cls_filename = root_name + 'classes.txt'
|
131 |
if cls_filename in namelist:
|
|
|
220 |
print(dataset.to_coco().cats)
|
221 |
self._classes = dataset.classes
|
222 |
self._zip_file = dataset.zip_file
|
223 |
+
first = self._zip_file.namelist()[0]
|
224 |
+
if self._zip_file.getinfo(first).is_dir():
|
225 |
+
self._root = first[-1]
|
226 |
+
else:
|
227 |
+
self._root = first.split('/')[0]
|
228 |
|
229 |
def __enter__(self):
|
230 |
# recursively create dir
|