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

Faild to run when using a folder of image for a person #9

Closed
ghost opened this issue Dec 9, 2020 · 10 comments
Closed

Faild to run when using a folder of image for a person #9

ghost opened this issue Dec 9, 2020 · 10 comments

Comments

@ghost
Copy link

ghost commented Dec 9, 2020

1.1 Preprocessing, running Preprocessor to detect the human boxes of ./results/primitives/processed/orig_images...
  0% 0/5 [00:00<?, ?it/s]
Process PreprocessConsumer_0:
Traceback (most recent call last):
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 77, in run
    visual=True,
  File "/content/iPERCore/iPERCore/tools/processors/base_preprocessor.py", line 81, in execute
    self._execute_detector(processed_info, factor=factor)
  File "/content/iPERCore/iPERCore/tools/processors/base_preprocessor.py", line 298, in _execute_detector
    cur_shape = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 80, in run
    except Exception("model error!") as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
		Pre-processing: digital deformation start...
Process HumanDigitalDeformConsumer_0:
Traceback (most recent call last):
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 136, in run
    prepared_inputs = self.prepare_inputs_for_run_cloth_smpl_links(process_info)
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 210, in prepare_inputs_for_run_cloth_smpl_links
    src_infos = process_info.convert_to_src_info(self.opt.num_source)
  File "/content/iPERCore/iPERCore/services/options/process_info.py", line 140, in convert_to_src_info
    src_infos = read_src_infos(self.vid_infos, num_source)
  File "/content/iPERCore/iPERCore/services/options/process_info.py", line 233, in read_src_infos
    pad_ids = np.random.choice(src_ids, need_pad)
  File "mtrand.pyx", line 908, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 153, in run
    except Exception("model error!") as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
		Pre-processing: digital deformation completed...
the current number of sources are 1, while the pre-defined number of sources are 2. 
	Pre-processing: failed...
@ghost
Copy link
Author

ghost commented Dec 9, 2020

It seems that it fails to detect the person in the folder. However, using one image will work without any problem.

@StevenLiuWen
Copy link
Collaborator

StevenLiuWen commented Dec 9, 2020

@acc557 Firstly, there must be a person in the source image. Also, what's the src_path in your script, and the path must be correct in the src_path. Providing the src_path you used with us, maybe we can further know your problem.

@ghost
Copy link
Author

ghost commented Dec 9, 2020

@StevenLiuWen
There was one and only person in the source image.
I am running on colab and you can reproduce this issue by changing the src_path from

src_path = "\"path?=/content/iPERCore/assets/samples/sources/afan_6/afan_6=ns=2," \
             "name?=afan_6=ns=2," \
             "bg_path?=/content/iPERCore/assets/samples/sources/afan_6/IMG_7217.JPG\""

to

src_path = "\"path?=/content/iPERCore/assets/samples/sources/afan_6/afan_6," \
             "name?=afan_6=ns=2," \
             "bg_path?=/content/iPERCore/assets/samples/sources/afan_6/IMG_7217.JPG\""

The new folder contains more than one image from afan_6, and it crashes the code.

@ghost
Copy link
Author

ghost commented Dec 9, 2020

I think the bug may be related to detecting the the front and back of the person.

I tried the front and back image respectively and they both works fine when they are not given as a folder.

Is it possible to bypass the detection and use a prefix or suffix in filename to specify the front or back?

@StevenLiuWen
Copy link
Collaborator

StevenLiuWen commented Dec 9, 2020

@acc557 , It seems that you rename the same name?=afan_6=ns=2. The name must be unique. It seems that there is a name with afan_6=ns=2 with only two images. While you want to use the folder afan_6 with more than two images. They are different inputs. You might need to change it to

src_path = "\"path?=/content/iPERCore/assets/samples/sources/afan_6/afan_6," \
             "name?=afan_6," \
             "bg_path?=/content/iPERCore/assets/samples/sources/afan_6/IMG_7217.JPG\""

@ghost
Copy link
Author

ghost commented Dec 9, 2020

@acc557 , It seems that you rename the same name?=afan_6=ns=2. The name must be unique. It seems that there is a name with afan_6=ns=2 with only two images. While you want to use the folder afan_6 with more than two images. They are different inputs. You might need to change it to

src_path = "\"path?=/content/iPERCore/assets/samples/sources/afan_6/afan_6," \
             "name?=afan_6," \
             "bg_path?=/content/iPERCore/assets/samples/sources/afan_6/IMG_7217.JPG\""

I also tried this, but saw the same error. I also tired using my own images(only two), but the problem persists.

@StevenLiuWen
Copy link
Collaborator

StevenLiuWen commented Dec 9, 2020

@acc557, we can run it successfully with the afan_6 folder. If your outputs_dir is './results'.
Try to delete the folder ./results/models/afan and results/primitives/afan_6, and run the script again.

@ghost
Copy link
Author

ghost commented Dec 9, 2020

@acc557, we can run it successfully with the afan_6 folder. If your outputs_dir is './results'.
You delete the folder ./results/models/afan and results/primitives/afan_6, and run the script again.

It seems to work with the afan_6 folder after deleting the result folder. Now I am trying my own images.

@StevenLiuWen
Copy link
Collaborator

StevenLiuWen commented Dec 9, 2020

@acc557 Ok. It seems that when the preprocessing failed, (mostly happens with rename withe same project name, or the path does not exist), our system did not clean the processed folder, and will still encounter some problems when the name is unique and put the right path.

In this commit, we add a clean folder function to clean the processed folder when the preprocessing failed.
effefe1#diff-b431b9b56890dd64e98ac5d725389d007080a426b6a2c6336194ba02e212ac85R345

@ghost
Copy link
Author

ghost commented Dec 9, 2020

Thanks! It works great this time. :)

I guess that colab did not sync the filesystem with the left browsing panel last time.

@ghost ghost closed this as completed Dec 9, 2020
This issue was closed.
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

1 participant