Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-MMC
Implementation of MMC-AMQ
Commits
7d2d3a1d
Commit
7d2d3a1d
authored
Jun 25, 2026
by
Carl De Sousa Trias
Browse files
Update for requirement instalation
parent
aabd38aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
AMQ.py
View file @
7d2d3a1d
...
@@ -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
)
...
...
README.md
View file @
7d2d3a1d
...
@@ -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
```
```
requirements.txt
View file @
7d2d3a1d
...
@@ -3,3 +3,4 @@ transformers
...
@@ -3,3 +3,4 @@ transformers
datasets
datasets
pillow
pillow
soundfile
soundfile
sentencepiece
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment