Open raefu opened 2 years ago
@raefu
It seems that code (in the start of process_mask_parts
function) replacing re-loading image produces different results. And these results are worse than from original method. It crops parts of the object and make holes in its body.
### ORIGINAL
plt.imsave(filename,torch.sigmoid(these_preds[i][0]))
img = cv2.imread(filename)
gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
### YOUR PATCH
arr = torch.sigmoid(these_preds[i][0]).cpu()
arr = (arr.numpy() * 256).astype(numpy.uint8)
Use frog
as a prompt for extension.
Image | Original code with refined weights | New code from patch |
---|---|---|
Also your commit introduces space indentation in new lines, in some lines it is not constant even (some with 8 spaces, some with 4 spaces). I fixed it in: https://github.com/Eugenii10/txt2mask/tree/fixed-raefu-patch-1
https://github.com/timojl/clipseg#new-fine-grained-weights