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

DenseCaptioning contains hardcoded paths to local env #5

Closed kgonia closed 1 year ago

kgonia commented 1 year ago
    def __init__(self) -> None:
        self.grit_working_directory = "../GRiT/"
        self.grit_env_python = '/home/aiops/wangjp/anaconda3/envs/grit/bin/python'
        self.grit_script = 'image_dense_captions.py'
        self.model_weights = 'models/grit_b_densecap_objectdet.pth'
FingerRec commented 1 year ago

Follow install.md, replace with your own env.

mickelliu commented 1 year ago

You probably also need to create a grit_output.txt, it is also hardcoded as well.

https://github.com/showlab/Image2Paragraph/blob/2a2b8f3893733c9dba9186b1b2c9a4a948b34dbd/models/grit_model.py#L29

FingerRec commented 1 year ago

hi, we have integrated the grit into our code, no need to install grit independently anymore, follow install.md for details.

kgonia commented 1 year ago

Cool, I didn't have time to catch up. Seems my code adjustments are obsolete now :)