jpcurbelo / human-body-reshape-DL-paper

Official Code for "A methodology for realistic human shape reconstruction from 2D images"
MIT License
1 stars 2 forks source link

long time #8

Open OmariNewAeon opened 4 days ago

OmariNewAeon commented 4 days ago

Thanks for your great work I run the code on your input data but no output data this final result and the code is running a long time what is the expected time to show output ??

2024-09-29 15:39:18.460307: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. 2024-09-29 15:39:20.698902: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. [1] Starting to load input data (2 photos and basic info) E:\human-body-reshape-DL-paper\src\photos2avatar.py:139: FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True) input_df = input_df.replace("male", 1) Using cache found in C:\Users\mohmm/.cache\torch\hub\pytorch_vision_v0.10.0 [1] Finished loading input data (2 photos and basic info) in 0.4 s [2] Starting to extract the silhouettes from input images (front and side views) Starting front view -- Finished front view in 0.5 s Starting side view -- Finished side view in 0.0 s [2] Finished extracting the silhouettes from input images (front and side) in 1.4 s [3] Loading the previously trained extractor model. 2024-09-29 15:39:36.337729: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

jpcurbelo commented 3 days ago

Hi, @OmariNewAeon. Thanks for your interest! I wasn't able to reproduce your issue. Here are a few comments that I hope help us to understand what is happening:

1 - That step [3] is to load the extractor_nn_model.h5 file (see the first image). If it exists, it should be loaded pretty quickly.

2 - See the second (no scaler file nor silhouettes exists, so, they are to be created) and third (scaler and silhouettes are loaded) images to have an idea of the processing times for each step.

3 - Also see the output files to be created after the code is done running (4th image)

I wonder what tensorflow and torchvision version you are using. Also, I just committed a few updates to clear cache and save some memory on torchvision operations when creating the silhouette files - in case that helps.

image image image image

OmariNewAeon commented 2 days ago

Thanks, I updated TensorFlow to version 2.13.0 and displayed the result. However, I need to ask if the input front image and input side image need to have any specific conditions, aside from the pose.

jpcurbelo commented 2 days ago

I'm glad that worked. About the conditions for the input images, I would say that the closer to the position in the first figure, the better - trying the body to be centered with no inclination. Although the model is supposed to run some data augmentation cases during prediction to, somehow, compensate potential deviations. This was also considered during training to make the model more robust (see fig 2)

# Generate augmented images and accumulate
for _ in range(NUM_AUG_INPUT):
    batch_img_front_aug = datagen_input.flow(
        input_img_front,
        batch_size=1,
        shuffle=False,
        seed=random.randint(0, 100),
    ).next()[0]

    # Generate augmented images and accumulate
    input_img_front_aug_accum.append(batch_img_front_aug)
    batch_img_side_aug = datagen_input.flow(
        input_img_side,
        batch_size=1,
        shuffle=False,
        seed=random.randint(0, 100),
    ).next()[0]
    input_img_side_aug_accum.append(batch_img_side_aug)

image image