Commit 43f5759 1 parent 6faeeac commit 43f5759 Copy full SHA for 43f5759
File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ def decode_to_image(encoding):
107
107
108
108
def mask_decode_to_image (encoding ):
109
109
image = decode_to_image (encoding )
110
+ print (f"mask_decode_to_image image before { type (image )} " )
110
111
try :
111
112
# response = requests.get('http://0.0.0.0:8080/sam/sam-model')
112
113
# print(f'\nsam/sam-model: {response.text}\n')
@@ -115,13 +116,15 @@ def mask_decode_to_image(encoding):
115
116
if "Success" in response .text :
116
117
# print(f'\nsam/heartbeat: {response.text}\n')
117
118
image = encode_pil_to_base64 (image )
119
+ print (f"mask_decode_to_image image mid { type (image )} " )
118
120
response = requests .post ('http://0.0.0.0:8080/sam/heartbeat' , json = {
119
121
"input_image" : image ,
120
122
"mask" : image ,
121
123
"dilate_amount" : 16
122
124
})
123
125
if "masked_image" in response :
124
126
image = decode_base64_to_image (response .masked_image )
127
+ print (f"mask_decode_to_image image after { type (image )} " )
125
128
print (f'SAM successfully dilated mask by 16.' )
126
129
127
130
else :
You can’t perform that action at this time.
0 commit comments