jjz5463 commited on
Commit
a7f93f9
·
1 Parent(s): ebe5082
Files changed (1) hide show
  1. baseline_utils.py +3 -15
baseline_utils.py CHANGED
@@ -64,22 +64,10 @@ def analyze_writer_image(image_path, api_key):
64
  genai.configure(api_key=api_key)
65
  model = genai.GenerativeModel("gemini-1.5-flash")
66
  myfile = genai.upload_file(image_path)
67
- color = model.generate_content(
68
- [myfile, "\n\n", "What is the predominant color of the person in the image? Answer in 1 word."]
69
  )
70
- description = f"""
71
- The writer is a cartoonish, fluffy cat with large, expressive blue eyes.
72
- Its fur is predominantly {color}, with subtle shading on certain parts of its body in a slightly darker or lighter shade of {color}.
73
- The face is round with soft, slightly pointed ears that are highlighted with an inner coloring also in {color}.
74
-
75
- The most prominent feature of the cat is its extremely fluffy, oversized tail, which arcs gracefully above its body.
76
- The tail fur is thick, feathery, and has a luxurious texture that stands out against the rest of the body, showcasing
77
- a gradient effect from darker to lighter shades of {color} at the edges.
78
-
79
- The cat’s paws are small and round, with shading in a slightly darker shade of {color}.
80
- The overall look of the figure is cute, gentle, and meticulously detailed, emphasizing a soft and playful appearance.
81
- """
82
- return description #result.text
83
 
84
 
85
  # Now that you have text from the diary and text describing the diary writer,
 
64
  genai.configure(api_key=api_key)
65
  model = genai.GenerativeModel("gemini-1.5-flash")
66
  myfile = genai.upload_file(image_path)
67
+ result = model.generate_content(
68
+ [myfile, "\n\n", "Can you give a very short description of the person in the image?"]
69
  )
70
+ return result.text
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
 
73
  # Now that you have text from the diary and text describing the diary writer,