microsoft / GenerativeImage2Text

GIT: A Generative Image-to-text Transformer for Vision and Language
MIT License
542 stars 68 forks source link

Python SDK? #60

Open sudoku-lord opened 8 months ago

sudoku-lord commented 8 months ago

Hi! This is a superb tool. I was wondering if any kind of Python SDK or integration is available––something which would make GIT easier to use in a piece of code as opposed to just on the command line. Thanks so much!

amsword commented 1 week ago

the command line is actually more about to call a function, e.g. you can call the function of inference() rather than using the command line. the inference code has already been integrated in huggingface, and thus all the tools in huggingface may be applicable. please also feel free to share your ideas on how the python sdk would look like.

AZFUSE_TSV_USE_FUSE=1 python -m generativeimage2text.inference -p "{'type': 'test_git_inference_single_image', \
      'image_path': 'aux_data/images/1.jpg', \
      'model_name': 'GIT_BASE', \
      'prefix': '', \
}"