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

Bad quality results #8

Open
danigoju opened this issue Apr 26, 2023 · 15 comments
Open

Bad quality results #8

danigoju opened this issue Apr 26, 2023 · 15 comments

Comments

@danigoju
Copy link

Good afternoon!

First of all thank you very much for your nice work! The code has some errors, but after fixing them and running everything in Colab separately I got the results seen in the image. Is it something expected to get this bad quality result, or there is something wrong? In case you think there is something wrong, do you have any idea what could it be?

Thank you very much for your time in advance 😄

image

@24thTinyGiant
Copy link

@danigoju can you tell how did you ran the openpose file , I'm trying to run it but not able to generate the json output PLEASE HELP

@danigoju
Copy link
Author

danigoju commented May 1, 2023

@danigoju can you tell how did you ran the openpose file , I'm trying to run it but not able to generate the json output PLEASE HELP

I am running on CPU, therefore you have to make these modifications:

  1. Add CPU_ONLY flag when installing
    !cd openpose && rm -rf build || true && mkdir build && cd build && cmake -DBUILD_PYTHON=ON -DGPU_MODE:STRINGS=CPU_ONLY .. && make -jnproc

  2. Run the following, after running the previous steps
    os.chdir('/content')
    !cd openpose && ./build/examples/openpose/openpose.bin --image_dir /content/inputs/test/image/ --write_json /content/inputs/test/openpose-json/ --display 0 --render_pose 0 --hand
    !cd openpose && ./build/examples/openpose/openpose.bin --image_dir /content/inputs/test/image/ --display 0 --write_images /content/inputs/test/openpose-img/ --hand --render_pose 1 --disable_blending true

@24thTinyGiant
Copy link

Okay 👌 👍

@SanyaPark
Copy link

@danigoju
Oh, that works! I owe you.

@QUFETI
Copy link

QUFETI commented Jun 4, 2023

Good afternoon!

First of all thank you very much for your nice work! The code has some errors, but after fixing them and running everything in Colab separately I got the results seen in the image. Is it something expected to get this bad quality result, or there is something wrong? In case you think there is something wrong, do you have any idea what could it be?

Thank you very much for your time in advance 😄

image

i am not getting output can you share you code ?

@24thTinyGiant
Copy link

@QUFETI run the code in the order given in the run.py file individually that might help and run the openpose as mentioned above in this conservation page this might solve your issue

@QUFETI
Copy link

QUFETI commented Jun 10, 2023

@QUFETI run the code in the order given in the run.py file individually that might help and run the openpose as mentioned above in this conservation page this might solve your issue

can you provide your modify code ! i don't know why i am not getting output even i follow the above steps but know use! replay me soon if any one got the output please

@24thTinyGiant
Copy link

first install openpose

second step:
!pip install ninja

third step:
!git clone https://github.com/PeikeLi/Self-Correction-Human-Parsing
%cd Self-Correction-Human-Parsing
!mkdir checkpoints

fourth step:
dataset = 'lip'
import gdown

if dataset == 'lip':
url = 'https://drive.google.com/uc?id=1k4dllHpu0bdx38J7H28rVVLpU-kOHmnH'
elif dataset == 'atr':
url = 'https://drive.google.com/uc?id=1ruJg4lqR_jgQPj-9K0PP-L2vJERYOxLP'
elif dataset == 'pascal':
url = 'https://drive.google.com/uc?id=1E5YwNKW2VOEayK9mWCS3Kpsxf-3z04ZE'

output = 'checkpoints/final.pth'
gdown.download(url, output, quiet=False)
%cd inputs
from google.colab import files
uploaded = files.upload()
%cd ..

fifth step:
%cd /content/
!rm -rf clothes-virtual-try-on
!git clone https://github.com/practice404/clothes-virtual-try-on.git
os.makedirs("/content/clothes-virtual-try-on/checkpoints")

sixth step:
!gdown --id 18q4lS7cNt1_X8ewCgya1fq0dSk93jTL6 --output /content/clothes-virtual-try-on/checkpoints/alias_final.pth
!gdown --id 1uDRPY8gh9sHb3UDonq6ZrINqDOd7pmTz --output /content/clothes-virtual-try-on/checkpoints/gmm_final.pth
!gdown --id 1d7lZNLh51Qt5Mi1lXqyi6Asb2ncLrEdC --output /content/clothes-virtual-try-on/checkpoints/seg_final.pth

seventh step:
!gdown --id 1ysEoAJNxou7RNuT9iKOxRhjVRNY5RLjx --output /content/clothes-virtual-try-on/cloth_segm_u2net_latest.pth --no-cookies

eighth step:
%cd /content/
!conda install --channel conda-forge featuretools --yes
!wget -q https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.tar.gz
!tar xfz cmake-3.13.0-Linux-x86_64.tar.gz --strip-components=1 -C /usr/local
!pip install matplotlib
!pip install opencv-python torchgeometry
!pip install torchvision

nineth step:

%%bash
MINICONDA_INSTALLER_SCRIPT=Miniconda3-4.5.4-Linux-x86_64.sh
MINICONDA_PREFIX=/usr/local
wget https://repo.continuum.io/miniconda/$MINICONDA_INSTALLER_SCRIPT
chmod +x $MINICONDA_INSTALLER_SCRIPT
./$MINICONDA_INSTALLER_SCRIPT -b -f -p $MINICONDA_PREFIX
conda install --channel defaults conda python=3.8 --yes
conda update --channel defaults --all --yes

tenth step:
import os
os.chdir('/content')
!cd openpose && ./build/examples/openpose/openpose.bin --image_dir /content/inputs/test/image/ --write_json /content/inputs/test/openpose-json/ --display 0 --render_pose 0 --hand
!cd openpose && ./build/examples/openpose/openpose.bin --image_dir /content/inputs/test/image/ --display 0 --write_images /content/inputs/test/openpose-img/ --hand --render_pose 1 --disable_blending true

eleventh step:
%cd /content/Self-Correction-Human-Parsing
!python3 simple_extractor.py --dataset 'lip' --model-restore 'checkpoints/final.pth' --input-dir '/content/inputs/test/image/' --output-dir '/content/inputs/test/image-parse'

twelfth step:
%cd /content/clothes-virtual-try-on
!python cloth-mask.py

thirteenth step:
model_image = os.listdir('/content/inputs/test/image')
cloth_image = os.listdir('/content/inputs/test/cloth')
pairs = zip(model_image, cloth_image)
with open('/content/inputs/test_pairs.txt', 'w') as file:
for model, cloth in pairs:
file.write(f"{model} {cloth}")
fourteenth step:

!pip install ipython

%cd /content/clothes-virtual-try-on
!python /content/clothes-virtual-try-on/test.py --name outputs --dataset_dir /content/inputs --checkpoint_dir /content/clothes-virtual-try-on/checkpoints --save_dir /content/

@masa8
Copy link

masa8 commented Dec 31, 2023

I followed setup_gradio.ipynb and got this result.

Screenshot 2023-12-31 at 22 56 31

download-10

@masa8
Copy link

masa8 commented Dec 31, 2023

Result of Sample image looks much better ⭐️
I want to know what factors affect result.

Screenshot 2023-12-31 at 23 13 34 Screenshot 2023-12-31 at 23 13 56

@masa8
Copy link

masa8 commented Dec 31, 2023

Tried changing Cloth image size to 768x1024 and background color to white and got this result:
I would like to know if the following problems can be solved

  • The green colour has turned grey.
  • Sleeve length changes
  • Wrinkles are reproduced as a pattern and are positioned incorrectly
Screenshot 2023-12-31 at 23 38 30 Screenshot 2023-12-31 at 23 39 07

@masa8
Copy link

masa8 commented Dec 31, 2023

It may be necessary to ensure that photos are taken without wrinkles in the clothing.
and the back of the collar seems to need to be in the background.
Screenshot 2023-12-31 at 23 58 08
Screenshot 2023-12-31 at 23 58 27

@masa8
Copy link

masa8 commented Dec 31, 2023

F.Y.I.
Screenshot 2024-01-01 at 0 28 08
Screenshot 2024-01-01 at 0 28 21

@adithyarajagopal
Copy link

How do i avoid the list index out of range error

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 517, in predict
output = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 216, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1555, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1193, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 654, in wrapper
response = f(*args, **kwargs)
File "", line 13, in run
op = os.listdir("/content/output")[0]
IndexError: list index out of range

@amalthomas2003
Copy link

How do i avoid the list index out of range error

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 517, in predict output = await route_utils.call_process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 216, in call_process_api output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1555, in process_api result = await self.call_function( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1193, in call_function prediction = await anyio.to_thread.run_sync( File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 654, in wrapper response = f(*args, **kwargs) File "", line 13, in run op = os.listdir("/content/output")[0] IndexError: list index out of range

I have the same issue. Did you find a solution?

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

7 participants