Skip to content

Commit

Permalink
fixing the absence of a vqa model (#150)
Browse files Browse the repository at this point in the history
* fixing the absence of a VQA model
  • Loading branch information
piterand authored Sep 26, 2023
1 parent a57e67b commit 32d1321
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ammico/notebooks/image_summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Here you can choose between two models: `\"base\"` or `\"large\"`. This will generate the caption for each image and directly put the results in your dictionary `mydict`. Then you can transform it into the dataframe and this dataframe can be exported as a .csv file.\n",
"Here you can choose between models: `\"base\"` or `\"large\"`. This will generate the caption for each image and directly put the results in your dictionary `mydict`. Then you can transform it into the dataframe and this dataframe can be exported as a .csv file.\n",
"\n",
"The results are written in the columns: \n",
"- `const_image_summary` - the permanent summaries, which do not change from run to run (analyse_image).\n",
Expand Down Expand Up @@ -201,7 +201,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Set the list of questions as a list of strings `list_of_questions`, load the models to the memory and pass them to the function"
"Load the model to the memory through object creation with parameters `analysis_type=\"questions\"` and `model_type=\"vqa\"`. Set the list of questions as a list of strings `list_of_questions`, and pass them to the function"
]
},
{
Expand All @@ -223,7 +223,7 @@
"metadata": {},
"outputs": [],
"source": [
"obj = ammico.SummaryDetector(mydict, analysis_type=\"questions\", list_of_questions = list_of_questions)"
"obj = ammico.SummaryDetector(mydict, analysis_type=\"questions\", model_type=\"vqa\")"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion ammico/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class SummaryDetector(AnalysisMethod):
allowed_model_types = [
"base",
"large",
"vqa",
]
allowed_new_model_types = [
"blip2_t5_pretrain_flant5xxl",
Expand Down Expand Up @@ -44,7 +45,7 @@ def __init__(
Args:
subdict (dict, optional): Dictionary containing the image to be analysed. Defaults to {}.
model_type (str, optional): Type of model to use. Can be "base" or "large" for blip_caption. Or can be one of the new models:
model_type (str, optional): Type of model to use. Can be "base" or "large" or "vqa" for blip_caption and VQA. Or can be one of the new models:
"blip2_t5_pretrain_flant5xxl",
"blip2_t5_pretrain_flant5xl",
"blip2_t5_caption_coco_flant5xl",
Expand Down

0 comments on commit 32d1321

Please sign in to comment.