Skip to content

Commit

Permalink
moved variables to config.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
barzansaeedpour committed Jul 28, 2024
1 parent 02f074f commit 5da0fde
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 154 deletions.
45 changes: 45 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"numbers": [
{ "ch": "1", "position": [100, 30], "size": [40, 115] },
{ "ch": "2", "position": [100, 30], "size": [60, 115] },
{ "ch": "3", "position": [100, 30], "size": [60, 115] },
{ "ch": "4", "position": [100, 30], "size": [60, 115] },
{ "ch": "5", "position": [100, 30], "size": [60, 115] },
{ "ch": "6", "position": [100, 30], "size": [60, 115] },
{ "ch": "7", "position": [100, 30], "size": [60, 115] },
{ "ch": "8", "position": [100, 30], "size": [60, 115] },
{ "ch": "9", "position": [100, 30], "size": [60, 115] }
],

"mini_numbers": [
{ "ch": "0", "position": [100, 90], "size": [40, 40] },
{ "ch": "1", "position": [100, 50], "size": [40, 100] },
{ "ch": "2", "position": [100, 50], "size": [57, 100] },
{ "ch": "3", "position": [100, 50], "size": [57, 100] },
{ "ch": "4", "position": [100, 50], "size": [57, 100] },
{ "ch": "5", "position": [100, 50], "size": [57, 100] },
{ "ch": "6", "position": [100, 50], "size": [57, 100] },
{ "ch": "7", "position": [100, 50], "size": [57, 100] },
{ "ch": "8", "position": [100, 50], "size": [57, 100] },
{ "ch": "9", "position": [100, 50], "size": [57, 100] }
],

"chars": [
{ "ch": "EIN", "position": [260, 30], "size": [110, 110] },
{ "ch": "B", "position": [260, 50], "size": [110, 90] },
{ "ch": "N", "position": [265, 35], "size": [100, 100] },
{ "ch": "T", "position": [252, 30], "size": [120, 110] },
{ "ch": "H", "position": [275, 50], "size": [80, 80] },
{ "ch": "D", "position": [270, 40], "size": [90, 90] },
{ "ch": "Q", "position": [265, 40], "size": [100, 100] },
{ "ch": "J", "position": [265, 40], "size": [100, 100] },
{ "ch": "HE", "position": [265, 40], "size": [100, 100] },
{ "ch": "SIN", "position": [260, 55], "size": [110, 80] },
{ "ch": "SAD", "position": [260, 55], "size": [110, 80] },
{ "ch": "TA", "position": [270, 30], "size": [90, 110] },
{ "ch": "V", "position": [280, 40], "size": [70, 100] },
{ "ch": "M", "position": [280, 40], "size": [70, 100] },
{ "ch": "Y", "position": [270, 40], "size": [90, 100] },
{ "ch": "L", "position": [275, 35], "size": [70, 110] }
]
}
162 changes: 8 additions & 154 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,165 +3,19 @@
# from remove_background import remove_background_HE
import os
import random
import json

os.makedirs('./output/',exist_ok=True)

# List of items to choose from
numbers = [
{"ch":'1',
"position":[100, 30],
"size":[40, 115],
},
{"ch":'2',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'3',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'4',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'5',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'6',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'7',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'8',
"position":[100, 30],
"size":[60, 115],
},
{"ch":'9',
"position":[100, 30],
"size":[60, 115],
},
]

mini_numbers = [
{"ch":'0',
"position":[100, 90],
"size":(40, 40),
},
{"ch":'1',
"position":[100, 50],
"size":(40, 100),
},
{"ch":'2',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'3',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'4',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'5',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'6',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'7',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'8',
"position":[100, 50],
"size":(57, 100),
},
{"ch":'9',
"position":[100, 50],
"size":(57, 100),
},
]

chars = [
# {"ch":'P',
# "position":(260, 30),
# "size":(110, 110),
# },
{"ch":'EIN',
"position":(260, 30),
"size":(110, 110),
},
{"ch":'B',
"position":(260, 50),
"size":(110, 90),
},
{"ch":'N',
"position":(265, 35),
"size":(100, 100),
},
{"ch":'T',
"position":(252, 30),
"size":(120, 110),
},
{"ch":'H',
"position":(275, 50),
"size":(80, 80),
},
{"ch":'D',
"position":(270, 40),
"size":(90, 90),
},
{"ch":'Q',
"position":(265, 40),
"size":(100, 100),
},
{"ch":'J',
"position":(265, 40),
"size":(100, 100),
},
{"ch":'HE',
"position":(265, 40),
"size":(100, 100),
},
{"ch":'SIN',
"position":(260, 55),
"size":(110, 80),
},
{"ch":'SAD',
"position":(260, 55),
"size":(110, 80),
},
{"ch":'TA',
"position":(270, 30),
"size":(90, 110),
},
{"ch":'V',
"position":(280, 40),
"size":(70, 100),
},
{"ch":'M',
"position":(280, 40),
"size":(70, 100),
},
{"ch":'Y',
"position":(270, 40),
"size":(90, 100),
},
{"ch":'L',
"position":(275, 35),
"size":(70, 110),
},
]

with open('config.json', 'r') as file:
data = json.load(file)

numbers = data['numbers']
mini_numbers = data['mini_numbers']
chars = data['chars']

for i in range(2000):
for i in range(2):
# Open the background image

# Make a random choice from the list
Expand Down

0 comments on commit 5da0fde

Please sign in to comment.