Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build hugging faces tutorial #634

Closed
bw4sz opened this issue Mar 25, 2024 · 11 comments
Closed

Build hugging faces tutorial #634

bw4sz opened this issue Mar 25, 2024 · 11 comments
Labels
good first issue Good for newcomers

Comments

@bw4sz
Copy link
Collaborator

bw4sz commented Mar 25, 2024

I think its time we have a gradio app on hugging faces. Can we clone this app and edit from there?

https://huggingface.co/spaces/AndresHdzC/pytorch-wildlife

I think this is a 'good first issue', in the sense it won't take much DeepForest knowledge, but it will take some experience with hugging faces.

Steps

  1. Clone https://huggingface.co/spaces/AndresHdzC/pytorch-wildlife/blob/main/app.py
  2. Integrate the getting started tutorial for birds and tree models.
  3. Show screenshots from local gradio app
  4. Get clearance from @ethanwhite for huggingfaces space
  5. Upload and test
    Connected to model hosting issue Model library #317 and GSOC conversation Getting Start with Google Summer of Code (GSOC) #628
  • Would we want to use predict_image or predict_tile? No way to know what size of images to upload, we will need some kind of instruction or logic to guess whether we need to cut images into pieces.
@ethanwhite ethanwhite added the good first issue Good for newcomers label Mar 25, 2024
@ethanwhite
Copy link
Member

Anyone looking for a somewhat more complex issue that is still manageable without a deep understanding of the code base - this is a good one. Enjoy!

@Om-Doiphode
Copy link
Contributor

Om-Doiphode commented Mar 26, 2024

I have issued a Pull request for this issue. I have completed the first three steps. Can you please elaborate on the 5th step? Also can you please tell me if I have missed out on anything? Thanks!

@ethanwhite
Copy link
Member

@Om-Doiphode - can you send me your huggingface username so I can add you to our organization so you can upload this to the right place

@ethanwhite
Copy link
Member

@bw4sz is there cost associated with this?

@Om-Doiphode
Copy link
Contributor

@Om-Doiphode - can you send me your huggingface username so I can add you to our organization so you can upload this to the right place

Yeah sure. Following is my username: HawkeyeHS (https://huggingface.co/HawkeyeHS)

@Om-Doiphode
Copy link
Contributor

Hi @ethanwhite, I have accepted the invite to Hugging Face, how can I push the app to the Hugging Face spaces? Should I push it using my API key since in the organization's settings it says that the organization API tokens have been deprecated and to migrate the system to use User Access Tokens?

@ethanwhite
Copy link
Member

ethanwhite commented Mar 27, 2024

@Om-Doiphode - I've created a huggingface space for this. It's a git repo and there are instructions on the page for getting linked up to it so that you can push your draft app:

https://huggingface.co/spaces/weecology/deepforest-demo

If you don't have a git history you can just follow the instructions at that link. If you already have a git history for this project that you'd like to keep let me know and I can walk you through how to connect your local repo to huggingface directly instead of following the instructions for cloning.

@Om-Doiphode
Copy link
Contributor

Hi @ethanwhite, thank you for creating the space. I have pushed my draft app on the space, please review it. Thanks!

@ethanwhite
Copy link
Member

Looks great to me! Can you add a mention of this to the docs?

@bw4sz - take a look when you get the chance and see what you think

@bw4sz
Copy link
Collaborator Author

bw4sz commented Mar 28, 2024

Great start!

image
  • Let's increase the default thickness for predict birds, in predict_tile, thickness = 3? The predictions right now are hard to see, they are there if you squint. We might need some logic for the thickness. If the image is less than 1000 pixels, thickness is 1, over 1000 thickness = 2, more than 5000, thickness = 3?
Screenshot 2024-03-28 at 12 02 40 PM
  • we want to format the errors to show users how they can fix any test images. For example, right now it gives 'error'. it should return the error.
Screenshot 2024-03-28 at 12 20 03 PM

@Om-Doiphode
Copy link
Contributor

Om-Doiphode commented Mar 30, 2024

Looks great to me! Can you add a mention of this to the docs?

@bw4sz - take a look when you get the chance and see what you think

I have added the link to the app in the docs in the Getting Started and Prebuilt models sections. I have also added error handling for model prediction.

@bw4sz bw4sz closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants