I found the solution, but a new problem has emerged.
What I want to do is to segment a video and label each class. My first idea is to assign different class labels to different mask_image colors (you can see what I did for this below). However, I noticed that the output mask video changes the colors between different frames, making it difficult for me to track the labels (such as cookie/person and so on). I checked your code and found that you did the same thing to the video as the images. So, it is not surprising to get such a result.
Therefore, I wonder if you could share some of your ideas regarding this. Thanks!
What I did (In sam_predictor.py line 139):
'''
combined_mask = mask_image # combined_mask = cv2.add(frame, mask_image)
out.write(combined_mask)
'''
What I want to do is to segment a video and label each class. My first idea is to assign different class labels to different mask_image colors (you can see what I did for this below). However, I noticed that the output mask video changes the colors between different frames, making it difficult for me to track the labels (such as cookie/person and so on). I checked your code and found that you did the same thing to the video as the images. So, it is not surprising to get such a result.
Therefore, I wonder if you could share some of your ideas regarding this. Thanks!
What I did (In sam_predictor.py line 139): ''' combined_mask = mask_image # combined_mask = cv2.add(frame, mask_image) out.write(combined_mask) '''
Originally posted by @CRH400AF-A in https://github.com/kadirnar/segment-anything-video/issues/91#issuecomment-1662436068