Coder Social home page Coder Social logo

Comments (3)

moosl avatar moosl commented on July 19, 2024 1

I updated the predict function, and it works now:

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

from face-swap.

tzktz avatar tzktz commented on July 19, 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 :)

from face-swap.

moosl avatar moosl commented on July 19, 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'

from face-swap.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.