Commit 6faeeac 1 parent 538faf9 commit 6faeeac Copy full SHA for 6faeeac
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ def mask_decode_to_image(encoding):
110
110
try :
111
111
# response = requests.get('http://0.0.0.0:8080/sam/sam-model')
112
112
# print(f'\nsam/sam-model: {response.text}\n')
113
- if "Success" in requests .get ('http://0.0.0.0:8080/sam/heartbeat' ):
113
+ response = requests .get ('http://0.0.0.0:8080/sam/heartbeat' )
114
+ print (f'\n sam/sam-model: { response .text } \n ' )
115
+ if "Success" in response .text :
114
116
# print(f'\nsam/heartbeat: {response.text}\n')
115
117
image = encode_pil_to_base64 (image )
116
118
response = requests .post ('http://0.0.0.0:8080/sam/heartbeat' , json = {
@@ -120,12 +122,13 @@ def mask_decode_to_image(encoding):
120
122
})
121
123
if "masked_image" in response :
122
124
image = decode_base64_to_image (response .masked_image )
125
+ print (f'SAM successfully dilated mask by 16.' )
123
126
124
127
else :
125
- print (f'!!!! Error: sam did not return a masked_image!' )
128
+ print (f'!!!! Error: SAM did not return a masked_image!' )
126
129
raise HTTPException (status_code = 500 , detail = "Error: sam did not return a masked_image!" )
127
130
else :
128
- print (f'!!!! Error: sam heartbeat lost!' )
131
+ print (f'!!!! Error: SAM heartbeat lost!' )
129
132
except Exception as err :
130
133
pass
131
134
You can’t perform that action at this time.
0 commit comments