showlab / Image2Paragraph

[A toolbox for fun.] Transform Image into Unique Paragraph with ChatGPT, BLIP2, OFA, GRIT, Segment Anything, ControlNet.
Apache License 2.0
789 stars 53 forks source link

fix region_semantic #21

Open kgonia opened 1 year ago

kgonia commented 1 year ago

When ssa is used region_semantic don't work properly

self.region_semantic_model.region_semantic(img_src) in image_text_transformation.py

is called without region_classify_model param so it always fallback to 'edit_anything'. It causes error when 'ssa ' was used for initalization. region_semantic method should use same model as in init so param is no needed.