kengboon
First commit
7ff0bff
import os
import gradio as gr
from src.predict import predict
description = """
Detect both location (bounding box) and keypoints of trousers. πŸ‘–
<a href="https://huggingface.co/kengboon/keypointrcnn-trousers" target="_blank"><img src="https://img.shields.io/badge/Download%20Model%20Weight-EA9F00?style=for-the-badge&logoColor=white&logo=huggingface" height="40" alt="Download Model Weight"/></a>
"""
def get_examples(dir="examples/images"):
return [os.path.join(dir, f) for f in os.listdir(dir) if f.endswith((".bmp", ".jpg", "jpeg", "png", "gif", "tiff"))]
def main():
gr_intf = gr.Interface(
title="Trousers Detection",
description=description,
fn=predict,
inputs=[
gr.Image(label="Image")
],
outputs=[
gr.Image(label="Detection")
],
examples=get_examples(),
flagging_mode="never"
)
gr_intf.launch()
if __name__ == "__main__":
main()