Commit 7d2d3a1d authored by Carl De Sousa Trias's avatar Carl De Sousa Trias
Browse files

Update for requirement instalation

parent aabd38aa
...@@ -35,10 +35,10 @@ class TextandImageQuery(): ...@@ -35,10 +35,10 @@ class TextandImageQuery():
Apply an NN to answer the question Apply an NN to answer the question
''' '''
raw_image=Image.open(raw_image_path).convert("RGB") raw_image=Image.open(raw_image_path).convert("RGB")
pipe = pipeline("visual-question-answering", model="Salesforce/blip-vqa-base",device=device) pipe = pipeline("image-text-to-text", model="Salesforce/blip-vqa-base",device=device)
output = pipe(raw_image, question, top_k=1)[0] output = pipe(raw_image, question, top_k=1)[0]
return output['answer'] return output['generated_text']
def run(self): def run(self):
self.AnswerText = self.funcTextandImageQuery(self.RawImage, self.QuestionText) self.AnswerText = self.funcTextandImageQuery(self.RawImage, self.QuestionText)
......
...@@ -20,6 +20,11 @@ The OSD-AMQ Reference Software is found at the NNW gitlab site. It contains: ...@@ -20,6 +20,11 @@ The OSD-AMQ Reference Software is found at the NNW gitlab site. It contains:
Code was designed and tested on an Ubuntu 20.04 operating system using anaconda 23.7.2 and Python 3.9. Code was designed and tested on an Ubuntu 20.04 operating system using anaconda 23.7.2 and Python 3.9.
An environment with all the necessary libraries can be created using: An environment with all the necessary libraries can be created using:
```bash ```bash
conda create --name <env> --file requirements.txt conda create --name <env>
pip install -r requirements.txt
```
Based on your ffmpeg installation you might also needs :
```bash
conda install -c conda-forge ffmpeg
``` ```
...@@ -3,3 +3,4 @@ transformers ...@@ -3,3 +3,4 @@ transformers
datasets datasets
pillow pillow
soundfile soundfile
sentencepiece
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment