{"id":34066261,"url":"https://github.com/hansalemaos/generate_training_data_ml","last_synced_at":"2026-04-08T15:31:35.079Z","repository":{"id":61950546,"uuid":"556505955","full_name":"hansalemaos/generate_training_data_ml","owner":"hansalemaos","description":"Great object detection results without spending a lot of time! This package generates training data for yolov5 which will save you a lot of time and sanity.","archived":false,"fork":false,"pushed_at":"2022-10-27T15:29:38.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-14T05:05:35.683Z","etag":null,"topics":["bot","botting","detection","lazy","object","python","yolov5"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/generate-training-data-ml/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansalemaos.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-24T01:28:11.000Z","updated_at":"2024-03-13T02:58:19.000Z","dependencies_parsed_at":"2022-10-24T02:45:29.313Z","dependency_job_id":null,"html_url":"https://github.com/hansalemaos/generate_training_data_ml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hansalemaos/generate_training_data_ml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fgenerate_training_data_ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fgenerate_training_data_ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fgenerate_training_data_ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fgenerate_training_data_ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansalemaos","download_url":"https://codeload.github.com/hansalemaos/generate_training_data_ml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fgenerate_training_data_ml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","botting","detection","lazy","object","python","yolov5"],"created_at":"2025-12-14T06:26:36.401Z","updated_at":"2026-04-08T15:31:35.054Z","avatar_url":"https://github.com/hansalemaos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Great results without spending a lot of time\n\nThis package generates training data for yolov5 which will save you a lot of time and sanity.\nGetting the results that you can see in the video took me about 15 minutes of work and 6 hours of yolov5 training (50,000 images).\nSo far, I have used the package only for \"button like objects\" and it has been working well. For more sophisticated objects, you probably need to create the training data manually.\n\n```python\npip install generate-training-data-ml\n```\n\nExample - **Royale High** from Roblox [I had to help out my daughter :) ]\n\n\u003cdiv align=\"left\"\u003e\n      \u003ca href=\"https://www.youtube.com/watch?v=-jXqL39Tf5w\"\u003e\n         \u003cimg src=\"https://img.youtube.com/vi/-jXqL39Tf5w/0.jpg\" style=\"width:100%;\"\u003e\n      \u003c/a\u003e\n\u003c/div\u003e\n\n#### Step 1\n\nTake **a lot of** random screenshots (PNG) from the game **WITHOUT** any of the buttons you want to find. If you are lazy like me, use frames from YouTube videos: [GitHub - hansalemaos/ytframedownloader](https://github.com/hansalemaos/ytframedownloader)\n\n\u003cimg title=\"\" src=\"https://github.com/hansalemaos/screenshots/raw/main/randomscreenshots.png\" alt=\"\"\u003e\n\n#### Step 2\n\nTake some screenshot of the buttons you want to find and save them as shown on the screenshot (PNG).\n\n\u003cimg src=\"https://github.com/hansalemaos/screenshots/raw/main/buttonsearch.png\"/\u003e\n\n#### Step 3\n\nDownload https://github.com/ultralytics/yolov5 to **/yolov5/ in your env**, install all requirements\n\n#### Step 4\n\nCreate a config file that looks like that\n\n```python\n[GENERAL]\nimage_background_folder=\"C:\\Users\\Gamer\\anaconda3\\envs\\dfdir\\alltrainingdata\"\nimage_button_folder = \"C:\\yolovtest\\buttonimages\"\nsave_path_generated_pics = \"C:\\trainingset\\generated_pics\"\nsave_path_generated_pics_separate = \"C:\\trainingset\\generated_pics_sep\"\nmaximum_buttons_on_pic=3\nnumber_of_pictures_to_generate=10000\nmax_overlapping_avoid=50000\nyaml_file=\"royal_halloween.yaml\"\n\n[TRAINING]\nmodel_file ='yolov5s.yaml'\npersonal_yaml=\"royal_halloween.yaml\"\nhypfile = \"hyp.scratch-low.yaml\"\nresolutionsize=640\nbatch=30\nepochs=4\nptfile=\"C:\\Users\\Gamer\\anaconda3\\envs\\dfdir\\yolov5\\yolov5s.pt\"\nworkers=4\ngenerated_pic_folder = \"C:\\trainingset\\generated_pics_sep\"\nname_for_set = \"royal_halloweennew\"\nsave_period=10\n\n\n[BUTTON0]\nclass_name=\"play_apple_game\"\nallowed_min_distance_from_zero_x=1\nallowed_min_distance_from_zero_y=1\nallowed_max_distance_from_zero_x=70\nallowed_max_distance_from_zero_y=70\nmax_x=25\nmax_y=25\nmin_x=15\nmin_y=15\ntransparency_min=1\ntransparency_max=50\nmax_negativ_rotation=-10\nmax_positiv_rotation=10\nadd_pixelboarder=1\nadd_pixelboarder_percentage=10\nunsharp_border=1\nunsharp_border_percentage=10\nrandom_crop=1\nrandom_crop_percentage=30\nrandom_crop_min=0\nrandom_crop_max=2\nrandom_blur=1\nrandom_blur_percentage=20\nrandom_blur_min=0.001\nrandom_blur_max=0.05\n\n\n[BUTTON1]\nclass_name=\"won_apples\"\nallowed_min_distance_from_zero_x=1\nallowed_min_distance_from_zero_y=1\nallowed_max_distance_from_zero_x=70\nallowed_max_distance_from_zero_y=70\nmax_x=50\nmax_y=50\nmin_x=40\nmin_y=40\ntransparency_min=1\ntransparency_max=10\nmax_negativ_rotation=-10\nmax_positiv_rotation=10\nadd_pixelboarder=1\nadd_pixelboarder_percentage=10\nunsharp_border=1\nunsharp_border_percentage=10\nrandom_crop=0\nrandom_crop_percentage=30\nrandom_crop_min=0\nrandom_crop_max=1\nrandom_blur=0\nrandom_blur_percentage=10\nrandom_blur_min=0.001\nrandom_blur_max=0.05\n...\n```\n\n**Explanation for the config file**\n\n```python\n[GENERAL] image_background_folder - folder where your background images are located\n[GENERAL] image_button_folder - folder where the buttons that you want to detect are located. Each button can have several different images. Each button's images must be in it's own folder. Folders must be consecutively numbered\n[GENERAL] save_path_generated_pics - Temp folder for generated files\n[GENERAL] save_path_generated_pics_separate - Finished generated training data\n[GENERAL] maximum_buttons_on_pic - Max number of random buttons on a generated image\n[GENERAL] number_of_pictures_to_generate - Total number of training images\n[GENERAL] max_overlapping_avoid - Number of times to try to not overlap buttons (if maximum_buttons_on_pic \u003e 1)\n[GENERAL] yaml_file - choose a filename with ending '.yaml', e.g. 'mygeneratedfiles.yaml'\n[TRAINING] model_file - One of https://github.com/ultralytics/yolov5#pretrained-checkpoints  , you might have to download them and put them into the yolov5 folder, maybe they get downloaded automatically\n[TRAINING] personal_yaml - copy what you wrote in [GENERAL] yaml_file\n[TRAINING] hypfile - I usually use \"hyp.scratch-low.yaml\" - check out the official documentation: https://github.com/ultralytics/yolov5\n[TRAINING] resolutionsize - Use 640, I haven't tested it with other values\n[TRAINING] batch - I use 30 with a RTX 2060 8 GB\n[TRAINING] epochs - 100 is good to start with - check out the official documentation: https://github.com/ultralytics/yolov5\n[TRAINING] ptfile - I start new models with yolov5s.pt and use later my own pretrained files - check out: https://github.com/ultralytics/yolov5#pretrained-checkpoints\n[TRAINING] workers - number of CPUs to use\n[TRAINING] generated_pic_folder - copy what you wrote in [GENERAL] save_path_generated_pics_separate\n[TRAINING] name_for_set - choose name for the set\n[BUTTON0] - each button must have its own section named BUTTON + next consecutively number\n[BUTTON0] class_name - choose a unique class name\n[BUTTON0] allowed_min_distance_from_zero_x - the minimum x distance in percent that the button can show up on the picture\n[BUTTON0] allowed_min_distance_from_zero_y - the minimum y distance in percent that the button can show up on the picture\n[BUTTON0] allowed_max_distance_from_zero_x - the maximum x distance in percent that the button can show up on the picture\n[BUTTON0] allowed_max_distance_from_zero_y - the maximum y distance in percent that the button can show up on the picture\n[BUTTON0] max_x - the max x size of the button in percent relative to the background picture, e.g. if you put 10 and your image has a width of 640, the max x size is 64\n[BUTTON0] max_y - the max y size of the button in percent relative to the background picture\n[BUTTON0] min_x - the min x size of the button in percent relative to the background picture, e.g. if you put 10 and your image has a width of 640, the min x size is 64\n[BUTTON0] min_y - the min y size of the button in percent relative to the background picture\n[BUTTON0] transparency_min  for random transparency, value will be substracted from alpha channel\n[BUTTON0] transparency_max - for random transparency, value will be substracted from alpha channel\n[BUTTON0] max_negativ_rotation - degrees to rotate button for random.randrange\n[BUTTON0] max_positiv_rotation - degrees to rotate button for random.randrange\n[BUTTON0] add_pixelboarder - 1 to enable, 0 to disable (for fuzzy border)\n[BUTTON0] add_pixelboarder_percentage - percentage of images to add the fuzzy border to\n[BUTTON0] unsharp_border - how many percent of the picture should become a fuzzy border (minimum)\n[BUTTON0] unsharp_border_percentage - how many percent of the picture should become a fuzzy border (maximum)\n[BUTTON0] random_crop - 1 to enable, 0 to disable, don't disable it for now, might cause problems\n[BUTTON0] random_crop_percentage - percentage of all images the crop should be applied to\n[BUTTON0] random_crop_min - how many pixels should be cropped (minimum)\n[BUTTON0] random_crop_max - how many pixels should be cropped (maximum)\n[BUTTON0] random_blur - 1 to enable, 0 to disable\n[BUTTON0] random_blur_percentage - percentage of all images the blur should be applied to\n[BUTTON0] random_blur_min - 0.001\n[BUTTON0] random_blur_max - 0.005\n```\n\n#### Step 5\n\n```python\n$ python generate_training_data_ml.py YOURCONFIGFILE\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/hansalemaos/screenshots/main/generateimgs.png\"/\u003e\n\nResults\n\n\u003cimg src=\"https://raw.githubusercontent.com/hansalemaos/screenshots/main/resultsscreenshots.png\"/\u003e\n\n```python\n#If you don't want to use the command line, you can import the module\nfrom generate_training_data_ml import generate_training_data\ngenerate_training_data(YOURCONFIGFILE)\n```\n\n**Now you can train the data with yolov5 (I uploaded another package to make your life easier)**\nhttps://github.com/hansalemaos/train_generated_data_ml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fgenerate_training_data_ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansalemaos%2Fgenerate_training_data_ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fgenerate_training_data_ml/lists"}