Skip to content

Commit

Permalink
remote outdated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dustysys committed Nov 6, 2022
1 parent 7c57be9 commit 7ba9bae
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions scripts/ddetailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,17 @@ def createmaskpreview(masks, image):

return preview_image

# Checks if PIL mask is all black
def isCompletelyBlack(mask):
cv2_mask = np.array(mask)
return cv2.countNonZero(cv2_mask) == 0

# Bitwise AND two PIL masks
def bitwiseANDmasks(mask1, mask2):
cv2_mask1 = np.array(mask1)
cv2_mask2 = np.array(mask2)
cv2_mask = cv2.bitwise_and(cv2_mask1, cv2_mask2)
mask = Image.fromarray(cv2_mask)
return mask

# Expand masks
def dilatemasks(masks, dilation_factor, iter=1):
if dilation_factor == 0:
return masks
Expand All @@ -366,7 +363,6 @@ def dilatemasks(masks, dilation_factor, iter=1):
dilated_masks.append(Image.fromarray(dilated_mask))
return dilated_masks

# Bitwise OR array of PIL masks
def combine_masks(masks):
initial_cv2_mask = np.array(masks[0])
combined_cv2_mask = initial_cv2_mask
Expand All @@ -380,7 +376,6 @@ def combine_masks(masks):
def on_ui_settings():
shared.opts.add_option("dd_same_seed", shared.OptionInfo(False, "Use same seed for all sub-images", section=("ddetailer", "Detection Detailer")))

# Create masks from segmented objects
def createsegmasks(results):
segms = results[2]
segmasks = []
Expand All @@ -399,7 +394,6 @@ def inference(image, modelname, conf_thres):
results = inference_mmdet_segm(image, modelname, conf_thres)
return results

# Get results from mmdet segm model
def inference_mmdet_segm(image, modelname, conf_thres):
model_checkpoint = modelpath(modelname)
model_config = os.path.splitext(model_checkpoint)[0] + ".py"
Expand All @@ -426,7 +420,6 @@ def inference_mmdet_segm(image, modelname, conf_thres):

return results

# Get results from mmdet face model
def inference_mmdet_bbox(image, modelname, conf_thres):
model_checkpoint = modelpath(modelname)
model_config = os.path.splitext(model_checkpoint)[0] + ".py"
Expand Down

0 comments on commit 7ba9bae

Please sign in to comment.