{"id":21230986,"url":"https://github.com/zyayoung/wechat_dljump","last_synced_at":"2025-07-10T16:33:17.641Z","repository":{"id":127007313,"uuid":"119240894","full_name":"zyayoung/wechat_DLjump","owner":"zyayoung","description":"微信跳一跳辅助","archived":false,"fork":false,"pushed_at":"2018-06-21T12:18:19.000Z","size":58502,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T15:11:14.920Z","etag":null,"topics":["convolutional-neural-networks","deep-learning","keras","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zyayoung.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-28T08:25:44.000Z","updated_at":"2021-11-24T16:52:25.000Z","dependencies_parsed_at":"2023-06-30T03:16:13.213Z","dependency_job_id":null,"html_url":"https://github.com/zyayoung/wechat_DLjump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zyayoung/wechat_DLjump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyayoung%2Fwechat_DLjump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyayoung%2Fwechat_DLjump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyayoung%2Fwechat_DLjump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyayoung%2Fwechat_DLjump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyayoung","download_url":"https://codeload.github.com/zyayoung/wechat_DLjump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyayoung%2Fwechat_DLjump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264608149,"owners_count":23636685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["convolutional-neural-networks","deep-learning","keras","python","tensorflow"],"created_at":"2024-11-20T23:40:19.244Z","updated_at":"2025-07-10T16:33:17.636Z","avatar_url":"https://github.com/zyayoung.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 微信跳一跳\n\n卷积神经网络判断棋子和目标块的坐标\n\n## 写在前面\n\n目前的网络已经达到3500分的水平。\n![example](https://raw.githubusercontent.com/zyayoung/image-repository/master/jump_example.png)\n\n为1080p分辨率开发\n\n## Requirements\n\n- PIL\n- tensorflow\n- keras\n- jupyter\n\n## 为什么要建立这个项目？\n\n之前写过朴素算法的跳一跳脚本，因为特殊情况不好处理，干脆尝试使用卷积神经网络处理。\n卷积神经网络在类似问题上有极大潜力。\n\n## 仓库内包含什么有用的东西？\n\n- 验证卷积神经网络解决此类问题的可行性\n- 方便修改的数据处理+网络训练脚本ExperimentSpace/CreatModel.ipynb(使用jupyter-notebook打开)\n- 预先采集的2500个训练数据data.pkl.gz\n- 预先训练的模型model.h5\n- 全自动玩游戏的脚本play.py(需要调整比例系数)\n\n## 数据预处理\n\n数据保存在ExperimentSpace/data.pkl.gz中\n\n数据读取方法：\n```\nf=gzip.open('data.pkl.gz')\nX_train,y_train = pickle.load(f)\nf.close()\n```\n\n数据简介：\n\n- 原始数据是2500张png截图，文件名包含训练需要的数据：编号,x,y,x,y\n- 对数据分别进行裁剪、缩放、边缘过滤、灰度\n```\nimg = img.crop((0, 500, 1080, 1300))\nimg = img.resize((img.width/resize_ratio, img.height/resize_ratio), Image.ANTIALIAS)\nimg = img.filter(ImageFilter.CONTOUR).convert('L')\nimg = np.array(img)/255.0\n```\n\n![example2](https://raw.githubusercontent.com/zyayoung/image-repository/master/jump_example2.png)\n\n- 打包成pickle.gz的形式\n```\nf=gzip.open('data.pkl.gz','wb')\nX_train = np.array(X_train,dtype='float32').reshape(-1,100,135,1)\ny_train = np.array(y_train,dtype='float32').reshape(-1,4)\npickle.dump((X_train,y_train),f)\nf.close()\n```\n\n详见[CreatModel.ipynb](https://github.com/zyayoung/wechat_DLjump/blob/master/ExperimentSpace/CreatModel.ipynb)\n\n## 我的网络结构\n\n```\n_________________________________________________________________\nLayer (type)                 Output Shape              Param #\n=================================================================\nconv2d_1 (Conv2D)            (None, 100, 135, 48)      1776\n_________________________________________________________________\nactivation_1 (Activation)    (None, 100, 135, 48)      0\n_________________________________________________________________\nmax_pooling2d_1 (MaxPooling2 (None, 50, 68, 48)        0\n_________________________________________________________________\nconv2d_2 (Conv2D)            (None, 50, 68, 64)        76864\n_________________________________________________________________\nactivation_2 (Activation)    (None, 50, 68, 64)        0\n_________________________________________________________________\nconv2d_3 (Conv2D)            (None, 50, 68, 64)        102464\n_________________________________________________________________\nactivation_3 (Activation)    (None, 50, 68, 64)        0\n_________________________________________________________________\nconv2d_4 (Conv2D)            (None, 50, 68, 64)        102464\n_________________________________________________________________\nactivation_4 (Activation)    (None, 50, 68, 64)        0\n_________________________________________________________________\nconv2d_5 (Conv2D)            (None, 50, 68, 64)        102464\n_________________________________________________________________\nactivation_5 (Activation)    (None, 50, 68, 64)        0\n_________________________________________________________________\nmax_pooling2d_2 (MaxPooling2 (None, 25, 34, 64)        0\n_________________________________________________________________\nconv2d_6 (Conv2D)            (None, 25, 34, 64)        102464\n_________________________________________________________________\nactivation_6 (Activation)    (None, 25, 34, 64)        0\n_________________________________________________________________\nmax_pooling2d_3 (MaxPooling2 (None, 13, 17, 64)        0\n_________________________________________________________________\nflatten_1 (Flatten)          (None, 14144)             0\n_________________________________________________________________\ndense_1 (Dense)              (None, 4)                 56580\n_________________________________________________________________\nactivation_7 (Activation)    (None, 4)                 0\n=================================================================\nTotal params: 545,076\nTrainable params: 545,076\nNon-trainable params: 0\n_________________________________________________________________\nNone\n```\n\n我觉得网络的结构和输出设计是最重要的，并且需要很多的尝试。\n\n从原理上来说输出坐标更合理。横纵坐标和距离是非线性关系，应该在神经网络给出两个坐标之后再用两点之间距离公式计算出距离。\n\n现在我的样本数量扩充到了2500， 推荐在github上找一个成熟项目，修改成自动获取样本的程序。\n\n## clone之后该做什么？\n\n- 解压model.h5.zip\n- 运行play.py\n- 探索ExperimentSpace/CreatModel.ipynb\n- 尝试下载其他人的项目，制作数据采集程序（可选）\n- 修改网络，训练网络\n\n\nGave me a star and do whatever you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyayoung%2Fwechat_dljump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyayoung%2Fwechat_dljump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyayoung%2Fwechat_dljump/lists"}