Open wbsljy opened 1 month ago
In the gradio_ootd.py file, you will find the variable called 'openpose_model_hd'.
Lines 20 to 26:
openpose_model_hd = OpenPose(0) parsing_model_hd = Parsing(0) ootd_model_hd = OOTDiffusionHD(0)
openpose_model_dc = OpenPose(1) parsing_model_dc = Parsing(1) ootd_model_dc = OOTDiffusionDC(1)
So if your GPU ID is 0, and you have only one GPU, then you should update your code, like
openpose_model_hd = OpenPose(0) parsing_model_hd = Parsing(0) ootd_model_hd = OOTDiffusionHD(0)
openpose_model_dc = openpose_model_hd parsing_model_dc = parsing_model_hd ootd_model_dc = ootd_model_hd
where OpenPose(0) identifies the GPU ID.
Traceback (most recent call last): File "/home/ljy/.local/lib/python3.8/site-packages/gradio/queueing.py", line 527, in process_events response = await route_utils.call_process_api( File "/home/ljy/.local/lib/python3.8/site-packages/gradio/route_utils.py", line 270, in call_process_api output = await app.get_blocks().process_api( File "/home/ljy/.local/lib/python3.8/site-packages/gradio/blocks.py", line 1887, in process_api result = await self.call_function( File "/home/ljy/.local/lib/python3.8/site-packages/gradio/blocks.py", line 1472, in call_function prediction = await anyio.to_thread.run_sync( File "/home/ljy/.local/lib/python3.8/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( File "/home/ljy/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread return await future File "/home/ljy/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 851, in run result = context.run(func, args) File "/home/ljy/.local/lib/python3.8/site-packages/gradio/utils.py", line 808, in wrapper response = f(args, **kwargs) File "gradio_ootd.py", line 83, in process_hd keypoints = openpose_model_hd(vton_img.resize((384, 512))) NameError: name 'openpose_model_hd' is not defined
使用gradio时,页面正常打开,但无法运行换装功能