franzi2505 commited on
Commit
9192ecd
2 Parent(s): 2b772af 59e18b1

Merge branch 'main' of https://huggingface.co/spaces/SEA-AI/PanopticQuality

Browse files
Files changed (2) hide show
  1. app.py +37 -4
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,6 +1,39 @@
1
- import evaluate
2
- from evaluate.utils import launch_gradio_widget
3
 
 
 
4
 
5
- module = evaluate.load("SEA-AI/PanopticQuality")
6
- launch_gradio_widget(module)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # import evaluate
2
+ # from evaluate.utils import launch_gradio_widget
3
 
4
+ # module = evaluate.load("SEA-AI/PanopticQuality")
5
+ # launch_gradio_widget(module)
6
 
7
+ from pathlib import Path
8
+ import sys
9
+ import gradio as gr
10
+
11
+
12
+ def read_markdown(filepath):
13
+ with open(filepath, 'r') as file:
14
+ lines = file.readlines()
15
+ start_index = None
16
+ end_index = None
17
+ for i, line in enumerate(lines):
18
+ if line.strip() == '---':
19
+ if start_index is None:
20
+ start_index = i
21
+ else:
22
+ end_index = i
23
+ break
24
+ if end_index is None:
25
+ return ''.join(
26
+ lines) # If no end delimiter found, return entire content
27
+ else:
28
+ return ''.join(lines[end_index +
29
+ 1:]) # Return content after end delimiter
30
+
31
+
32
+ local_path = Path(sys.path[0])
33
+ filepath = local_path / "README.md"
34
+ markdown_content = read_markdown(filepath)
35
+
36
+ with gr.Blocks() as demo:
37
+ gr.Markdown(markdown_content)
38
+
39
+ demo.launch()
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  git+https://github.com/huggingface/evaluate@main
2
  git+https://github.com/SEA-AI/seametrics@develop
3
- fiftyone
 
 
1
  git+https://github.com/huggingface/evaluate@main
2
  git+https://github.com/SEA-AI/seametrics@develop
3
+ fiftyone
4
+ torchmetrics