Open andysingal opened 1 year ago
Based on the error message, it seems like sam_model
inside the segment(...)
function has a value of None
, and that leads to an error once you try to call the set_image(...)
function on it.
In the code you provided, the sam_model
is coming from the sam_predictor
passed to the segment function, from this line:
segmented_frame_masks = segment(image_source, sam_predictor, boxes=detected_boxes)
So that means that the sam_predictor
variable is itself also None
. In the colab link you provided, that variable is supposed to be set from calling the load_sam_model()
function, but that function doesn't actually return anything. So to fix the problem that load_sam_model()
function should probably include an extra line: return sam_model
at the end of the function.
Based on the error message, it seems like
sam_model
inside thesegment(...)
function has a value ofNone
, and that leads to an error once you try to call theset_image(...)
function on it.In the code you provided, the
sam_model
is coming from thesam_predictor
passed to the segment function, from this line:segmented_frame_masks = segment(image_source, sam_predictor, boxes=detected_boxes)
So that means that the
sam_predictor
variable is itself alsoNone
. In the colab link you provided, that variable is supposed to be set from calling theload_sam_model()
function, but that function doesn't actually return anything. So to fix the problem thatload_sam_model()
function should probably include an extra line:return sam_model
at the end of the function.
Thanks , let me check and get back to you. Please keep the ticket open
Greetings, While working on creating mask using detected box, i got the following error:
i got the error:
article: https://medium.com/@amir_shakiba/sam-grounding-dino-stable-diffusion-segment-detect-change-da7926947286 colab: https://colab.research.google.com/drive/1d1zWF4YFQWwaEwYXEHEdl4jhzomZqXMb?usp=sharing
Looking forward to hearing from you Thanks