| | import gradio as gr |
| | import numpy as np |
| | import cv2 |
| | from PIL import Image |
| | from controlnet_aux import OpenposeDetector |
| | from gradio_client import Client |
| | from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler |
| | import torch |
| | |
| |
|
| |
|
| |
|
| |
|
| | from gradio_client import Client |
| |
|
| | client = Client("https://hysts-controlnet-v1-1.hf.space/") |
| | result = client.predict( |
| | "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", |
| | "Howdy!", |
| | "Howdy!", |
| | "Howdy!", |
| | 1, |
| | 256, |
| | 128, |
| | 1, |
| | 0.1, |
| | 0, |
| | "Openpose", |
| | api_name="/openpose" |
| | ) |
| | print("type(result)",type(result) ) |
| | print(result) |
| |
|
| |
|
| | |
| | |
| | |
| |
|
| | with gr.Blocks() as demo: |
| | with gr.Tab("Lion"): |
| | img1=gr.Image("Capture.PNG") |
| | print("IMG1",img1) |
| | print(type(img1)) |
| | print( type( np.array(img1) ) ) |
| | imgout=gr.Image(result) |
| | |
| |
|
| | btn1=gr.Button("bout") |
| | |
| | with gr.Tab("Tiger"): |
| | gr.Image() |
| | gr.Button("ebout") |
| |
|
| |
|
| |
|
| | demo.launch() |
| |
|
| |
|