Spaces:
Runtime error
Runtime error
better-references
#7
by
johnbradley
- opened
- 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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|