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

which version of gradio you are using? #1

Open
moosl opened this issue Mar 2, 2024 · 3 comments
Open

which version of gradio you are using? #1

moosl opened this issue Mar 2, 2024 · 3 comments

Comments

@moosl
Copy link

moosl commented Mar 2, 2024

Your repo is fantastic, and I'm very grateful for your sharing. I wanted to ask, which version of Gradio are you using? I encountered some errors while running it.

@tzktz
Copy link
Owner

tzktz commented Mar 2, 2024

Your repo is fantastic, and I'm very grateful for your sharing. I wanted to ask, which version of Gradio are you using? I encountered some errors while running it.

Use gradio version 3.5..It's works fine 👍 ..Still u face any issues let me know it glad to ans it :)

@moosl
Copy link
Author

moosl commented Mar 3, 2024

Your repo is fantastic, and I'm very grateful for your sharing. I wanted to ask, which version of Gradio are you using? I encountered some errors while running it.

Use gradio version 3.5..It's works fine 👍 ..Still u face any issues let me know it glad to ans it :)

I am using 3.50 also, when I run the code, it comes with this error:

Traceback (most recent call last):
  File "/data/xjl/face-swap/app.py", line 76, in <module>
    gr.inputs.Image(type="file", label="Target Image"),
  File "/home/nvidia/anaconda3/envs/face-swap/lib/python3.10/site-packages/gradio/blocks.py", line 115, in wrapper
    return fn(self, **kwargs)
  File "/home/nvidia/anaconda3/envs/face-swap/lib/python3.10/site-packages/gradio/inputs.py", line 252, in __init__
    super().__init__(
  File "/home/nvidia/anaconda3/envs/face-swap/lib/python3.10/site-packages/gradio/components/image.py", line 124, in __init__
    raise ValueError(
ValueError: Invalid value for parameter `type`: file. Please choose from one of: ['numpy', 'pil', 'filepath']

Then I update the code as follows:

iface = gr.Interface(
    fn=predictor.predict,
    inputs=[
        gr.inputs.Image(type="filepath", label="Target Image"),
        gr.inputs.Image(type="filepath", label="Swap Image")
    ],
    outputs=gr.outputs.Image(type="filepath", label="Result"),
    title=title,
    examples=[["input.jpg", "swap img.jpg"]])

The program was successfully launched, but when I run it on the gradio, it had this error, there is not output on the page.

'str' object has no attribute 'name'

@moosl
Copy link
Author

moosl commented Mar 3, 2024

I updated the predict function, and it works now:

frame = cv2.imread(input_image) source_face = self.get_face(cv2.imread(swap_image))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants