Spaces:
Runtime error
Runtime error
Commit
β’
c3cb09d
1
Parent(s):
8299190
better-references (#7)
Browse files- Fix typo in app header (1dad41ea0a822d219c4c645e075310b4600cdd26)
- Cleanup readme and app header (4ab5f2f2a0cbd8b28047a56d1d796c39c78f165b)
- Adds platform for the source code for clarity (f369fe75bfa2cd67f69e85568b06226be69c23d6)
Co-authored-by: Hilmar Lapp <hlapp@users.noreply.huggingface.co>
- README.md +5 -1
- app.py +11 -2
- app_header.md +0 -4
README.md
CHANGED
@@ -9,4 +9,8 @@ pinned: false
|
|
9 |
license: mit
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
9 |
license: mit
|
10 |
---
|
11 |
|
12 |
+
# Drexel Metadata App
|
13 |
+
Generate object detection metadata for a fish image using the [imageomics/Drexel-metadata-generator model](https://huggingface.co/imageomics/Drexel-metadata-generator).
|
14 |
+
The model will create a visualization based on the image, a mask of the fish outline, and JSON metadata.
|
15 |
+
The source code for the model is available on GitHub at [hdr-bgnn/drexel_metadata](https://github.com/hdr-bgnn/drexel_metadata).
|
16 |
+
|
app.py
CHANGED
@@ -53,9 +53,18 @@ def run_inference(input_img):
|
|
53 |
return visfname, maskfname, json_metadata
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
def read_app_header_markdown():
|
57 |
-
with open('
|
58 |
-
return infile.read()
|
|
|
59 |
|
60 |
dm_app = gr.Interface(
|
61 |
description=read_app_header_markdown(),
|
|
|
53 |
return visfname, maskfname, json_metadata
|
54 |
|
55 |
|
56 |
+
def try_remove_preamble(readme_md):
|
57 |
+
# Try to remove the huggingface preamble from README markdown
|
58 |
+
idx = readme_md.find("#")
|
59 |
+
if idx >= 0:
|
60 |
+
return readme_md[idx:]
|
61 |
+
return readme_md
|
62 |
+
|
63 |
+
|
64 |
def read_app_header_markdown():
|
65 |
+
with open('README.md') as infile:
|
66 |
+
return try_remove_preamble(infile.read())
|
67 |
+
|
68 |
|
69 |
dm_app = gr.Interface(
|
70 |
description=read_app_header_markdown(),
|
app_header.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
# Drexel Metadata
|
2 |
-
Generate object detection metadata for a fish image using the [imageomics/Drexel-metadata-generator model](https://huggingface.co/imageomics/Drexel-metadata-generator).
|
3 |
-
The model will create a visualization based on the image, a mask of the fish outline, and JSON metadata.
|
4 |
-
The source code for the model is available at [hdr-bgnn/drexel_metadata model](https://github.com/hdr-bgnn/drexel_metadata).
|
|
|
|
|
|
|
|
|
|