app.py内の動画処理機能の最大フレーム数制限を解除し、インターフェースのタイトルや説明文を日本語に更新しました。また、不要な例を削除しました。
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ def process_video(video_path):
|
|
56 |
# print(type(video_path))
|
57 |
# print(video_path)
|
58 |
|
59 |
-
model.segment_video(video_path) #
|
60 |
return output_path
|
61 |
|
62 |
# @spaces.GPU # ZeroGPU用 - 通常GPU使用時はコメントアウト
|
@@ -77,10 +77,6 @@ def process_file(f):
|
|
77 |
image = gr.Image(label="画像をアップロード")
|
78 |
video = gr.Video(label="動画をアップロード")
|
79 |
|
80 |
-
current_dir = os.path.dirname(os.path.abspath(__file__))
|
81 |
-
image_path = os.path.join(current_dir, "image.jpg")
|
82 |
-
examples = load_img(image_path, output_type="pil")
|
83 |
-
|
84 |
# Image processing tab
|
85 |
tab1 = gr.Interface(
|
86 |
fn,
|
@@ -89,7 +85,6 @@ tab1 = gr.Interface(
|
|
89 |
gr.Image(label="結果 前景"),
|
90 |
gr.File(label="PNGをダウンロード")
|
91 |
],
|
92 |
-
examples=[examples],
|
93 |
api_name="image"
|
94 |
)
|
95 |
|
@@ -99,16 +94,14 @@ tab2 = gr.Interface(
|
|
99 |
inputs=video,
|
100 |
outputs=gr.Video(label="結果動画"),
|
101 |
api_name="video",
|
102 |
-
title="動画処理(実験的)"
|
103 |
-
description="注意: ZeroGPUのタイムアウトのため、動画は最初の100フレームのみ処理されます。"
|
104 |
)
|
105 |
|
106 |
# Combined interface
|
107 |
demo = gr.TabbedInterface(
|
108 |
[tab1, tab2],
|
109 |
["画像処理", "動画処理"],
|
110 |
-
title="
|
111 |
-
# description="Note: Video processing is limited to the first 100 frames for performance reasons."
|
112 |
)
|
113 |
|
114 |
if __name__ == "__main__":
|
|
|
56 |
# print(type(video_path))
|
57 |
# print(video_path)
|
58 |
|
59 |
+
model.segment_video(video_path, max_frames=999999) # 制限を実質的に解除
|
60 |
return output_path
|
61 |
|
62 |
# @spaces.GPU # ZeroGPU用 - 通常GPU使用時はコメントアウト
|
|
|
77 |
image = gr.Image(label="画像をアップロード")
|
78 |
video = gr.Video(label="動画をアップロード")
|
79 |
|
|
|
|
|
|
|
|
|
80 |
# Image processing tab
|
81 |
tab1 = gr.Interface(
|
82 |
fn,
|
|
|
85 |
gr.Image(label="結果 前景"),
|
86 |
gr.File(label="PNGをダウンロード")
|
87 |
],
|
|
|
88 |
api_name="image"
|
89 |
)
|
90 |
|
|
|
94 |
inputs=video,
|
95 |
outputs=gr.Video(label="結果動画"),
|
96 |
api_name="video",
|
97 |
+
title="動画処理(実験的)"
|
|
|
98 |
)
|
99 |
|
100 |
# Combined interface
|
101 |
demo = gr.TabbedInterface(
|
102 |
[tab1, tab2],
|
103 |
["画像処理", "動画処理"],
|
104 |
+
title="背景除去ツール"
|
|
|
105 |
)
|
106 |
|
107 |
if __name__ == "__main__":
|