mirror of
https://github.com/karl0ss/comfy_fm24_newgens.git
synced 2025-04-28 20:03:40 +01:00
updated research py
This commit is contained in:
parent
936cbe039d
commit
3f19c46c54
@ -20,6 +20,8 @@ from comfy_api_simplified import ComfyApiWrapper, ComfyWorkflowWrapper
|
||||
|
||||
logging.config.dictConfig(LOGGING_CONFIG)
|
||||
|
||||
cut = 1000
|
||||
|
||||
# Load user configurations
|
||||
user_config = configparser.ConfigParser()
|
||||
try:
|
||||
@ -126,7 +128,7 @@ def main():
|
||||
|
||||
# Parse the RTF file
|
||||
try:
|
||||
rtf_file = rtf.parse_rtf(args.rtf_file)[:100]
|
||||
rtf_file = rtf.parse_rtf(args.rtf_file)[:cut]
|
||||
logging.info(f"Parsed RTF file successfully. Found {len(rtf_file)} players.")
|
||||
except FileNotFoundError:
|
||||
logging.error(f"RTF file not found: {args.rtf_file}")
|
||||
|
62
rtf_research.py
Normal file
62
rtf_research.py
Normal file
@ -0,0 +1,62 @@
|
||||
import sys
|
||||
from lib.rtf_parser import RTF_Parser
|
||||
|
||||
rtf = RTF_Parser()
|
||||
|
||||
# Parse the RTF file
|
||||
try:
|
||||
rtf_file = rtf.parse_rtf("./Gen.rtf")
|
||||
except FileNotFoundError:
|
||||
print("Error: RTF file not found.")
|
||||
sys.exit(1)
|
||||
|
||||
# Extract unique values with examples
|
||||
try:
|
||||
unique_hair_length = {}
|
||||
unique_hair_colour = {}
|
||||
unique_skin_tone = {}
|
||||
|
||||
for item in rtf_file:
|
||||
try:
|
||||
uid = item[0]
|
||||
name = item[8]
|
||||
hair_length = item[5]
|
||||
hair_colour = item[6]
|
||||
skin_tone = item[7]
|
||||
|
||||
# Add examples for unique hair lengths
|
||||
if hair_length not in unique_hair_length:
|
||||
unique_hair_length[hair_length] = []
|
||||
if len(unique_hair_length[hair_length]) < 3:
|
||||
unique_hair_length[hair_length].append({"UID": uid, "Name": name})
|
||||
|
||||
# Add examples for unique hair colours
|
||||
if hair_colour not in unique_hair_colour:
|
||||
unique_hair_colour[hair_colour] = []
|
||||
if len(unique_hair_colour[hair_colour]) < 3:
|
||||
unique_hair_colour[hair_colour].append({"UID": uid, "Name": name})
|
||||
|
||||
# Add examples for unique skin tones
|
||||
if skin_tone not in unique_skin_tone:
|
||||
unique_skin_tone[skin_tone] = []
|
||||
if len(unique_skin_tone[skin_tone]) < 3:
|
||||
unique_skin_tone[skin_tone].append({"UID": uid, "Name": name})
|
||||
|
||||
except IndexError:
|
||||
continue # Skip rows with missing columns
|
||||
|
||||
# Print sorted results
|
||||
print("Hair Lengths with examples (sorted):")
|
||||
for length in sorted(unique_hair_length.keys()):
|
||||
print(f"{length}: {unique_hair_length[length]}")
|
||||
|
||||
print("\nHair Colours with examples (sorted):")
|
||||
for colour in sorted(unique_hair_colour.keys()):
|
||||
print(f"{colour}: {unique_hair_colour[colour]}")
|
||||
|
||||
print("\nSkin Tones with examples (sorted):")
|
||||
for tone in sorted(unique_skin_tone.keys()):
|
||||
print(f"{tone}: {unique_skin_tone[tone]}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
Loading…
x
Reference in New Issue
Block a user