Spaces:
Paused
Paused
add cartoon feeling
Browse files- baseline_utils.py +7 -6
baseline_utils.py
CHANGED
@@ -44,10 +44,11 @@ def analyze_writer_image(image_path, api_key):
|
|
44 |
myfile = genai.upload_file(image_path)
|
45 |
result = model.generate_content(
|
46 |
[myfile,
|
47 |
-
"Provide a detailed description of the people in the picture
|
48 |
-
"
|
49 |
-
"
|
50 |
-
"Ensure the description is
|
|
|
51 |
)
|
52 |
return result.text
|
53 |
|
@@ -69,10 +70,10 @@ def break_diary_to_scenes(diary_text, writer_description, api_key):
|
|
69 |
messages=[
|
70 |
{
|
71 |
"role": "user",
|
72 |
-
"content": f"Please break the following diary into four distinct movie scenes: {diary_text}. Each scene should focus on one unique action and be described in vivid, animated detail. Below are some examples for the desired style: "
|
73 |
f"Example 1: {example_1}. Example 2: {example_2}. Example 3: {example_3}. Example 4: {example_4}. Example 5: {example_5}. "
|
74 |
f"Ensure that each scene features only one action, with no combinations (e.g., avoid 'eating and teaching' in one scene). The main character is described as: {writer_description}. "
|
75 |
-
f"Please use expressive, cinematic language to bring the scene to life, focusing on the character’s actions, expressions, and environment. "
|
76 |
f"Return the output as a list in this format: Scene 1: , Scene 2: , Scene 3: , Scene 4: , without any quotation marks or line breaks."
|
77 |
}
|
78 |
],
|
|
|
44 |
myfile = genai.upload_file(image_path)
|
45 |
result = model.generate_content(
|
46 |
[myfile,
|
47 |
+
"Provide a detailed description of the people in the picture by completely transforming them into a spiritual or symbolic animal. "
|
48 |
+
"Do not describe them as humans; instead, fully embody them as an animal. Describe their appearance, personality, and mood "
|
49 |
+
"as if they were this animal. For example, if someone has calm and gentle features, you might describe them as a panda. "
|
50 |
+
"Ensure that the entire description is centered on their transformation into this animal, using vivid and expressive language, "
|
51 |
+
"but without mentioning them as a person at all. Keep the description concise, without line breaks or unnecessary characters."]
|
52 |
)
|
53 |
return result.text
|
54 |
|
|
|
70 |
messages=[
|
71 |
{
|
72 |
"role": "user",
|
73 |
+
"content": f"Please break the following diary into four distinct cartoon movie scenes: {diary_text}. Each scene should focus on one unique action and be described in vivid, animated detail. Below are some examples for the desired style: "
|
74 |
f"Example 1: {example_1}. Example 2: {example_2}. Example 3: {example_3}. Example 4: {example_4}. Example 5: {example_5}. "
|
75 |
f"Ensure that each scene features only one action, with no combinations (e.g., avoid 'eating and teaching' in one scene). The main character is described as: {writer_description}. "
|
76 |
+
f"Please use expressive, cinematic language to bring the cartoon scene to life, focusing on the character’s actions, expressions, and environment. "
|
77 |
f"Return the output as a list in this format: Scene 1: , Scene 2: , Scene 3: , Scene 4: , without any quotation marks or line breaks."
|
78 |
}
|
79 |
],
|