Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ class ImageCaption:
|
|
10 |
def generate(self,img):
|
11 |
if isinstance(img,str):
|
12 |
img = Image.open(img)
|
13 |
-
text = "Explain this image,that what she is doing and what kind of expression is it"
|
14 |
-
input = self.processor(img,
|
15 |
# print(**input)
|
16 |
output = self.model.generate(**input)
|
17 |
caption = self.processor.decode(output[0],skip_special_tokens = True)
|
|
|
10 |
def generate(self,img):
|
11 |
if isinstance(img,str):
|
12 |
img = Image.open(img)
|
13 |
+
# text = "Explain this image,that what she is doing and what kind of expression is it"
|
14 |
+
input = self.processor(img,return_tensors='pt')
|
15 |
# print(**input)
|
16 |
output = self.model.generate(**input)
|
17 |
caption = self.processor.decode(output[0],skip_special_tokens = True)
|