K00B404 commited on
Commit
ea6caaa
·
verified ·
1 Parent(s): 591569e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -34,6 +34,11 @@ Some characters might be terse while others might be more verbose."""
34
  def generate_persona(img, min_len, max_len, persona_detail_level):
35
  # Process the image
36
  raw_image = Image.open(img).convert('RGB')
 
 
 
 
 
37
  inputs = processor(raw_image, return_tensors="pt")
38
 
39
  # Generate caption with specified length constraints
 
34
  def generate_persona(img, min_len, max_len, persona_detail_level):
35
  # Process the image
36
  raw_image = Image.open(img).convert('RGB')
37
+
38
+ # Resize image to 512x512
39
+ raw_image = raw_image.resize((256, 256), Image.Resampling.LANCZOS)
40
+
41
+
42
  inputs = processor(raw_image, return_tensors="pt")
43
 
44
  # Generate caption with specified length constraints