Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from OCR_test import process_image
|
|
| 7 |
# ====== Keep-Alive Background Thread ======
|
| 8 |
def keep_alive_worker():
|
| 9 |
# 替换为你的 HF Space 实际访问 URL(注意格式!)
|
| 10 |
-
space_url = "https://fcu52005505-
|
| 11 |
interval_sec = 86400 # 1 分钟 = 60 秒
|
| 12 |
|
| 13 |
print(f"[Keep-Alive] Starting background pinger. Pinging {space_url} every {interval_sec} seconds...")
|
|
@@ -42,7 +42,7 @@ interface = gr.Interface(
|
|
| 42 |
fn=detect_objects,
|
| 43 |
inputs=gr.Image(type="filepath", label="Upload Image"),
|
| 44 |
outputs=gr.Textbox(label="Detection Results"),
|
| 45 |
-
title="OCR Detection
|
| 46 |
description="Upload an image to get OCR results.",
|
| 47 |
examples=[
|
| 48 |
# 可选:添加示例图片路径(若你有放在 Space repo 的 example_images/)
|
|
|
|
| 7 |
# ====== Keep-Alive Background Thread ======
|
| 8 |
def keep_alive_worker():
|
| 9 |
# 替换为你的 HF Space 实际访问 URL(注意格式!)
|
| 10 |
+
space_url = "https://fcu52005505-test.hf.space"
|
| 11 |
interval_sec = 86400 # 1 分钟 = 60 秒
|
| 12 |
|
| 13 |
print(f"[Keep-Alive] Starting background pinger. Pinging {space_url} every {interval_sec} seconds...")
|
|
|
|
| 42 |
fn=detect_objects,
|
| 43 |
inputs=gr.Image(type="filepath", label="Upload Image"),
|
| 44 |
outputs=gr.Textbox(label="Detection Results"),
|
| 45 |
+
title="OCR Detection",
|
| 46 |
description="Upload an image to get OCR results.",
|
| 47 |
examples=[
|
| 48 |
# 可选:添加示例图片路径(若你有放在 Space repo 的 example_images/)
|