Spaces:
Sleeping
Sleeping
HaochenGong commited on
Commit ·
8c793f7
1
Parent(s): e4c79c3
- .idea/workspace.xml +14 -12
- CDM/detect_classify/classification.py +4 -2
- CDM/run_single.py +1 -1
- logs/app.log +24 -0
.idea/workspace.xml
CHANGED
|
@@ -4,9 +4,10 @@
|
|
| 4 |
<option name="autoReloadType" value="SELECTIVE" />
|
| 5 |
</component>
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
-
<list default="true" id="5e4481c0-7ba2-42e4-bbe6-4c36a0d36baa" name="Changes" comment="
|
| 8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 9 |
<change beforePath="$PROJECT_DIR$/CDM/detect_classify/classification.py" beforeDir="false" afterPath="$PROJECT_DIR$/CDM/detect_classify/classification.py" afterDir="false" />
|
|
|
|
| 10 |
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 11 |
<change beforePath="$PROJECT_DIR$/logs/app.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/app.log" afterDir="false" />
|
| 12 |
</list>
|
|
@@ -104,14 +105,7 @@
|
|
| 104 |
<workItem from="1723386970626" duration="451000" />
|
| 105 |
<workItem from="1723387453009" duration="27328000" />
|
| 106 |
<workItem from="1723978405562" duration="51637000" />
|
| 107 |
-
<workItem from="1725925225487" duration="
|
| 108 |
-
</task>
|
| 109 |
-
<task id="LOCAL-00012" summary="google drive">
|
| 110 |
-
<created>1723456794848</created>
|
| 111 |
-
<option name="number" value="00012" />
|
| 112 |
-
<option name="presentableId" value="LOCAL-00012" />
|
| 113 |
-
<option name="project" value="LOCAL" />
|
| 114 |
-
<updated>1723456794848</updated>
|
| 115 |
</task>
|
| 116 |
<task id="LOCAL-00013" summary="test auto delete">
|
| 117 |
<created>1723458331923</created>
|
|
@@ -449,7 +443,14 @@
|
|
| 449 |
<option name="project" value="LOCAL" />
|
| 450 |
<updated>1728916518798</updated>
|
| 451 |
</task>
|
| 452 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
<servers />
|
| 454 |
</component>
|
| 455 |
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -487,9 +488,10 @@
|
|
| 487 |
<MESSAGE value="." />
|
| 488 |
<MESSAGE value="remove dotenv" />
|
| 489 |
<MESSAGE value="font" />
|
| 490 |
-
<
|
|
|
|
| 491 |
</component>
|
| 492 |
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
| 493 |
-
<SUITE FILE_PATH="coverage/Cpp4App_test$app.coverage" NAME="app Coverage Results" MODIFIED="
|
| 494 |
</component>
|
| 495 |
</project>
|
|
|
|
| 4 |
<option name="autoReloadType" value="SELECTIVE" />
|
| 5 |
</component>
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
+
<list default="true" id="5e4481c0-7ba2-42e4-bbe6-4c36a0d36baa" name="Changes" comment="batch images">
|
| 8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 9 |
<change beforePath="$PROJECT_DIR$/CDM/detect_classify/classification.py" beforeDir="false" afterPath="$PROJECT_DIR$/CDM/detect_classify/classification.py" afterDir="false" />
|
| 10 |
+
<change beforePath="$PROJECT_DIR$/CDM/run_single.py" beforeDir="false" afterPath="$PROJECT_DIR$/CDM/run_single.py" afterDir="false" />
|
| 11 |
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 12 |
<change beforePath="$PROJECT_DIR$/logs/app.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/app.log" afterDir="false" />
|
| 13 |
</list>
|
|
|
|
| 105 |
<workItem from="1723386970626" duration="451000" />
|
| 106 |
<workItem from="1723387453009" duration="27328000" />
|
| 107 |
<workItem from="1723978405562" duration="51637000" />
|
| 108 |
+
<workItem from="1725925225487" duration="141465000" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
</task>
|
| 110 |
<task id="LOCAL-00013" summary="test auto delete">
|
| 111 |
<created>1723458331923</created>
|
|
|
|
| 443 |
<option name="project" value="LOCAL" />
|
| 444 |
<updated>1728916518798</updated>
|
| 445 |
</task>
|
| 446 |
+
<task id="LOCAL-00061" summary="batch images">
|
| 447 |
+
<created>1728919083991</created>
|
| 448 |
+
<option name="number" value="00061" />
|
| 449 |
+
<option name="presentableId" value="LOCAL-00061" />
|
| 450 |
+
<option name="project" value="LOCAL" />
|
| 451 |
+
<updated>1728919083992</updated>
|
| 452 |
+
</task>
|
| 453 |
+
<option name="localTasksCounter" value="62" />
|
| 454 |
<servers />
|
| 455 |
</component>
|
| 456 |
<component name="TypeScriptGeneratedFilesManager">
|
|
|
|
| 488 |
<MESSAGE value="." />
|
| 489 |
<MESSAGE value="remove dotenv" />
|
| 490 |
<MESSAGE value="font" />
|
| 491 |
+
<MESSAGE value="batch images" />
|
| 492 |
+
<option name="LAST_COMMIT_MESSAGE" value="batch images" />
|
| 493 |
</component>
|
| 494 |
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
| 495 |
+
<SUITE FILE_PATH="coverage/Cpp4App_test$app.coverage" NAME="app Coverage Results" MODIFIED="1728986730891" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
| 496 |
</component>
|
| 497 |
</project>
|
CDM/detect_classify/classification.py
CHANGED
|
@@ -177,7 +177,8 @@ def get_clf_model(clf_model="ResNet18", use_gpu=False):
|
|
| 177 |
|
| 178 |
return model
|
| 179 |
|
| 180 |
-
|
|
|
|
| 181 |
# load text and non-text compo
|
| 182 |
ele_id = 0
|
| 183 |
compos = []
|
|
@@ -359,9 +360,10 @@ def compo_classification(input_img, output_root, segment_root, merge_json, outpu
|
|
| 359 |
|
| 360 |
# =============================================================================
|
| 361 |
|
|
|
|
|
|
|
| 362 |
classification_start_time = time.process_time()
|
| 363 |
|
| 364 |
-
model = get_clf_model(clf_model)
|
| 365 |
comp_tensors = []
|
| 366 |
elements = []
|
| 367 |
|
|
|
|
| 177 |
|
| 178 |
return model
|
| 179 |
|
| 180 |
+
|
| 181 |
+
def compo_classification(input_img, output_root, segment_root, merge_json, output_data, resize_by_height=800, clf_model="ResNet18", model=get_clf_model("ResNet18")):
|
| 182 |
# load text and non-text compo
|
| 183 |
ele_id = 0
|
| 184 |
compos = []
|
|
|
|
| 360 |
|
| 361 |
# =============================================================================
|
| 362 |
|
| 363 |
+
# model = get_clf_model(clf_model)
|
| 364 |
+
|
| 365 |
classification_start_time = time.process_time()
|
| 366 |
|
|
|
|
| 367 |
comp_tensors = []
|
| 368 |
elements = []
|
| 369 |
|
CDM/run_single.py
CHANGED
|
@@ -133,7 +133,7 @@ def run_single_img(input_img, output_root, segment_root):
|
|
| 133 |
this_time_cost_ic, this_time_cost_ts, output_data, output_boards, classification_cost = clf.compo_classification(input_img, output_root,
|
| 134 |
segment_root, merge_json,
|
| 135 |
output_data,
|
| 136 |
-
resize_by_height=resize_by_height, clf_model="ViT")
|
| 137 |
|
| 138 |
ic_time_cost_all.append(this_time_cost_ic)
|
| 139 |
ts_time_cost_all.append(this_time_cost_ts)
|
|
|
|
| 133 |
this_time_cost_ic, this_time_cost_ts, output_data, output_boards, classification_cost = clf.compo_classification(input_img, output_root,
|
| 134 |
segment_root, merge_json,
|
| 135 |
output_data,
|
| 136 |
+
resize_by_height=resize_by_height, clf_model="ViT", model = clf.get_clf_model("ViT"))
|
| 137 |
|
| 138 |
ic_time_cost_all.append(this_time_cost_ic)
|
| 139 |
ts_time_cost_all.append(this_time_cost_ts)
|
logs/app.log
CHANGED
|
@@ -5,3 +5,27 @@
|
|
| 5 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 6 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 7 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 6 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 7 |
2024-10-15 02:12:40 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 8 |
+
2024-10-15 20:09:21 - INFO - Gradio app launched successfully
|
| 9 |
+
2024-10-15 20:58:07 - INFO - Application started
|
| 10 |
+
2024-10-15 20:58:07 - INFO - file_cache is only supported with oauth2client<4.0.0
|
| 11 |
+
2024-10-15 20:58:07 - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 12 |
+
2024-10-15 20:58:07 - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 13 |
+
2024-10-15 20:58:07 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 14 |
+
2024-10-15 20:58:07 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 15 |
+
2024-10-15 20:58:08 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 16 |
+
2024-10-15 20:58:55 - INFO - Gradio app launched successfully
|
| 17 |
+
2024-10-15 20:59:04 - INFO - Application started
|
| 18 |
+
2024-10-15 20:59:04 - INFO - file_cache is only supported with oauth2client<4.0.0
|
| 19 |
+
2024-10-15 20:59:04 - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 20 |
+
2024-10-15 20:59:04 - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 21 |
+
2024-10-15 20:59:04 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 22 |
+
2024-10-15 20:59:04 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 23 |
+
2024-10-15 20:59:04 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 24 |
+
2024-10-15 21:05:38 - INFO - Application started
|
| 25 |
+
2024-10-15 21:05:38 - INFO - file_cache is only supported with oauth2client<4.0.0
|
| 26 |
+
2024-10-15 21:05:38 - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 27 |
+
2024-10-15 21:05:38 - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 28 |
+
2024-10-15 21:05:38 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 29 |
+
2024-10-15 21:05:38 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 30 |
+
2024-10-15 21:05:39 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 31 |
+
2024-10-15 21:54:10 - INFO - Gradio app launched successfully
|