ZrrSkywalker / Personalize-SAM

Personalize Segment Anything Model (SAM) with 1 shot in 10 seconds
MIT License
1.5k stars 101 forks source link

Add multiple-object segmentation feature and fine-tuning on multiple images #25

Closed mlzoo closed 1 year ago

mlzoo commented 1 year ago

Add multiple-object segmentation feature and fine-tuning on multiple images.

OSSome01 commented 1 year ago

Is this for multiple-object segmentation of the same class? or is it also for multiple classes?

mlzoo commented 1 year ago

Is this for multiple-object segmentation of the same class? or is it also for multiple classes?

This is for multiple objects of the same class appearing in the one image.

Skwarson96 commented 1 year ago

Hi! @mlzoo is your code working? I found some syntax errors and many more errors, mainly: "local variable ... referenced before assignment"

ZrrSkywalker commented 1 year ago

@mlzoo Hi, thanks very much for your contribution! It means a lot for PerSAM to tackle multi-object scenarios.

mlzoo commented 1 year ago

Hi! @mlzoo is your code working? I found some syntax errors and many more errors, mainly: "local variable ... referenced before assignment"

Hi can you give me the error information?

Skwarson96 commented 1 year ago

@mlzoo At the beginning in line 67: print('Training size:', len() ^^^^^ SyntaxError: Generator expression must be parenthesized

mlzoo commented 1 year ago

@mlzoo At the beginning in line 67:

print('Training size:', len()

                        ^^^^^

SyntaxError: Generator expression must be parenthesized

My fault! Please delete that line... I will fix the bug later.

Skwarson96 commented 1 year ago

@mlzoo of course, but despite this, there are still errors, for example line 70 in persam_f_multi_obj.py: training_size = int(os.listdir(os.path.join(images_path, obj_name))) * args.training_percentage) I thing it should be: training_size = int(len(os.listdir(os.path.join(images_path, obj_name))) * args.training_percentage) But when I fix it I still get a lot of errors. Lot of variables are referenced before assignment