JackAILab / ConsistentID

Customized ID Consistent for human
MIT License
845 stars 76 forks source link

“WithoutBackground” #54

Open gaoyixuan111 opened 4 months ago

gaoyixuan111 commented 4 months ago

@JackAILab In the definition of the masks_for_unique_values function in your functions.py script, if the parsing_mask passed in does not contain any pixels with value=0, then the generated parsing_mask_list will not have the key "WithoutBackground". This means that in the __getitem__ method, you cannot generate the corresponding multi_clip_image. Could you add a solution for this issue?

body_raw_image = fetch_mask_raw_image(raw_image,parsing_mask_list["WithoutBackground"]) body_clip_image = self.clip_image_processor(images=body_raw_image, return_tensors="pt").pixel_values multi_clip_image = torch.cat([clip_image, body_clip_image], dim=1)

gaoyixuan111 commented 4 months ago

@JackAILab When I restarted training on your model, pre-training, I found that the printed facial_loss has been consistently negative around -0.004, I looked at the code and found that in the ID preserving network BalancedL1Loss returns background_loss - object_loss, and I'm not sure if Is it normal for facial_loss to be negative?