oguzhanercan commited on
Commit
816ed11
·
verified ·
1 Parent(s): d033c17

Upload promptgen.py

Browse files
Files changed (1) hide show
  1. promptgen.py +64 -0
promptgen.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+
3
+ # Helper functions for random features
4
+ def short_random_hair():
5
+ styles = ["long", "short", "shoulder-length", "buzzed", "medium-length", "curly", "straight", "wavy"]
6
+ colors = ["black", "brown", "blonde", "red", "gray", "white", "auburn", "golden"]
7
+ return f"{random.choice(styles)} {random.choice(colors)} hair"
8
+
9
+ def short_random_skin():
10
+ tones = ["fair", "light", "medium", "tan", "brown", "dark", "golden"]
11
+ return f"{random.choice(tones)} skin"
12
+
13
+ def short_random_face_structure():
14
+ shapes = ["oval face", "square face", "round face", "heart-shaped face", "diamond face"]
15
+ return random.choice(shapes)
16
+
17
+ def short_random_eyes():
18
+ colors = ["brown", "blue", "green", "gray", "hazel"]
19
+ return f"{random.choice(colors)} eyes"
20
+
21
+ def short_random_eyebrows():
22
+ types = ["arched", "thick", "thin", "rounded", "bushy"]
23
+ return f"{random.choice(types)} eyebrows"
24
+
25
+ def short_random_nose():
26
+ sizes = ["small nose", "medium nose", "large nose"]
27
+ return random.choice(sizes)
28
+
29
+ def short_random_mouth():
30
+ types = ["small lips", "full lips", "thin lips"]
31
+ return random.choice(types)
32
+
33
+ def short_random_facial_hair():
34
+ options = ["clean-shaven", "beard", "mustache", "stubble", "no facial hair"]
35
+ return random.choice(options)
36
+
37
+ def random_age():
38
+ return f"{random.randint(18, 75)}-year-old"
39
+
40
+ def random_gender():
41
+ return random.choice(["male", "female"])
42
+
43
+ def random_race():
44
+ return random.choice(["Caucasian", "African", "Asian", "Hispanic", "Middle Eastern",
45
+ "Native American", "Mixed race", "Pacific Islander", "South Asian", "Indigenous"])
46
+
47
+ # Generate 1000 shortened prompts
48
+ shortened_prompts = []
49
+ for _ in range(100000):
50
+ prompt = (
51
+ f"A {random_age()} {random_gender()} with {short_random_hair()}, {short_random_skin()}, "
52
+ f"{short_random_face_structure()}, {short_random_eyes()}, {short_random_eyebrows()}, "
53
+ f"{short_random_nose()}, {short_random_mouth()}, {short_random_facial_hair()}. "
54
+ f"Race: {random_race()}."
55
+ )
56
+ shortened_prompts.append(prompt)
57
+
58
+ # Save to a text file
59
+ file_path = "shortened_facial_description_prompts.txt"
60
+ with open(file_path, "w") as f:
61
+ for prompt in shortened_prompts:
62
+ f.write(prompt + "\n")
63
+
64
+ print(f"Prompts saved to {file_path}")