spdraptor commited on
Commit
8b87815
·
1 Parent(s): eebe067

fast api cod commit

Browse files
modules/__pycache__/masking_module.cpython-310.pyc CHANGED
Binary files a/modules/__pycache__/masking_module.cpython-310.pyc and b/modules/__pycache__/masking_module.cpython-310.pyc differ
 
modules/masking_module.py CHANGED
@@ -165,10 +165,11 @@ def masking_process(image,obj):
165
  response = run_sam_inference(SAM_IMAGE_MODEL, image, detections)
166
  print('5')
167
  if response['code'] == 400:
168
- return response
 
169
  else:
170
- detections2=response['data']
171
- mask = Image.fromarray(detections2.mask[0])
172
- response['data']=mask
173
- torch.cuda.empty_cache()
174
- return response
 
165
  response = run_sam_inference(SAM_IMAGE_MODEL, image, detections)
166
  print('5')
167
  if response['code'] == 400:
168
+ print("no object found")
169
+ return "no object found"
170
  else:
171
+ detections2=response['data']
172
+ mask = Image.fromarray(detections2.mask[0])
173
+ # response['data']=mask
174
+ torch.cuda.empty_cache()
175
+ return mask