{"action":"created","issue":{"url":"https://api.github.com/repos/ankush-me/SynthText/issues/114","repository_url":"https://api.github.com/repos/ankush-me/SynthText","labels_url":"https://api.github.com/repos/ankush-me/SynthText/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/ankush-me/SynthText/issues/114/comments","events_url":"https://api.github.com/repos/ankush-me/SynthText/issues/114/events","html_url":"https://github.com/ankush-me/SynthText/issues/114","id":323039301,"number":114,"title":"How to make Vertical Text Dataset?","user":{"login":"SSUHan","id":8327479,"avatar_url":"https://avatars0.githubusercontent.com/u/8327479?v=4","gravatar_id":"","url":"https://api.github.com/users/SSUHan","html_url":"https://github.com/SSUHan","followers_url":"https://api.github.com/users/SSUHan/followers","following_url":"https://api.github.com/users/SSUHan/following{/other_user}","gists_url":"https://api.github.com/users/SSUHan/gists{/gist_id}","starred_url":"https://api.github.com/users/SSUHan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SSUHan/subscriptions","organizations_url":"https://api.github.com/users/SSUHan/orgs","repos_url":"https://api.github.com/users/SSUHan/repos","events_url":"https://api.github.com/users/SSUHan/events{/privacy}","received_events_url":"https://api.github.com/users/SSUHan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-05-15T01:54:35Z","updated_at":"2018-05-21T14:14:47Z","closed_at":null,"author_association":"NONE","body":"Hello, I'm used your code for generating OCR dataset in many case. Thanks for your efforts really :D\r\n\r\nBut, I want to make vertical text image..\r\n\r\nhttps://github.com/ankush-me/SynthText/blob/master/text_utils.py#L165\r\nthis section would decide \"text mask\" rendering.. but It's hard to make vertical text data. At present, only horizontal characters are made.\r\n\r\non this line : https://github.com/ankush-me/SynthText/blob/master/text_utils.py#L219\r\n\r\noriginal code : \r\n```python\r\nnewrect = font.get_rect(ch)\r\nnewrect.y = last_rect.y\r\nif i > mid_idx:\r\nnewrect.topleft = (last_rect.topright[0]+2, newrect.topleft[1])\r\n            else:\r\n                newrect.topright = (last_rect.topleft[0]-2, newrect.topleft[1])\r\n            newrect.centery = max(newrect.height, min(fsize[1] - newrect.height, newrect.centery + curve[i]))\r\n            try:\r\n                bbrect = font.render_to(surf, newrect, ch, rotation=rots[i])\r\n            except ValueError:\r\n                bbrect = font.render_to(surf, newrect, ch)\r\n            bbrect.x = newrect.x + bbrect.x\r\n            bbrect.y = newrect.y - bbrect.y\r\n            bbs.append(np.array(bbrect))\r\n            last_rect = newrect\r\n```\r\n\r\nmy code : \r\n```python\r\nnewrect = font.get_rect(ch)\r\n            # newrect.y = last_rect.y\r\n            newrect.x = last_rect.x\r\n            if i > mid_idx:\r\n                # print(ch, \" <- right\")\r\n                # newrect.topleft = (last_rect.topright[0] + 2, newrect.topleft[1])\r\n                # newrect.topleft = (last_rect.topright[0], newrect.topleft[1] + 2)\r\n                # newrect.topleft = (newrect.topright[0], last_rect.topleft[1] + 2)\r\n                # newrect.topright = (newrect.bottomright[0], last_rect.bottomright[1] + 3)\r\n                newrect.topleft = (newrect.bottomleft[0], last_rect.bottomleft[1] + 2)\r\n            else:\r\n                # print(ch, \" <- left\")\r\n                # newrect.topright = (last_rect.topleft[0] - 2, newrect.topleft[1])\r\n                # newrect.topright = (last_rect.topleft[0], newrect.topleft[1] - 2)\r\n                # newrect.topright = (newrect.topright[0], last_rect.topleft[1] - 2)\r\n                newrect.bottomright = (newrect.topright[0], last_rect.topright[1] - 2)\r\n            newrect.centery = max(newrect.height, min(fsize[1] - newrect.height, newrect.centery + curve[i]))\r\n            # newrect.centerx = max(newrect.width, min(fsize[0] - newrect.width, newrect.centerx + curve[i]))\r\n            try:\r\n                bbrect = font.render_to(surf, newrect, ch, rotation=rots[i])\r\n            except ValueError:\r\n                print(\"render error, without rotation..\")\r\n                bbrect = font.render_to(surf, newrect, ch)\r\n            bbrect.x = newrect.x + bbrect.x\r\n            bbrect.y = newrect.y - bbrect.y\r\n            bbs.append(np.array(bbrect))\r\n            last_rect = newrect\r\n```\r\n\r\nsample result : \r\n<img width=\"530\" alt=\"2018-05-15 10 44 29\" src=\"https://user-images.githubusercontent.com/8327479/40032153-d737bc24-582d-11e8-9b34-e62445e1d433.png\">\r\n<img width=\"347\" alt=\"2018-05-15 10 44 36\" src=\"https://user-images.githubusercontent.com/8327479/40032169-ecb17ec8-582d-11e8-8bde-6682786e9170.png\">\r\n<img width=\"556\" alt=\"2018-05-15 10 44 43\" src=\"https://user-images.githubusercontent.com/8327479/40032186-fc9766fe-582d-11e8-9029-21377c44e5cc.png\">\r\n\r\nsample result with annotation : \r\n<img width=\"512\" alt=\"2018-05-15 10 45 05\" src=\"https://user-images.githubusercontent.com/8327479/40032196-07b65464-582e-11e8-9ac1-ba3e55398e8b.png\">\r\n<img width=\"332\" alt=\"2018-05-15 10 45 12\" src=\"https://user-images.githubusercontent.com/8327479/40032202-13cefc74-582e-11e8-963d-b9993fb669e8.png\">\r\n<img width=\"552\" alt=\"2018-05-15 10 45 19\" src=\"https://user-images.githubusercontent.com/8327479/40032207-1b406240-582e-11e8-9af3-1819ac1fa18e.png\">\r\n\r\nThe possibilities are there, but they are not perfect. \r\nI really need your help..\r\n\r\nThanks.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ankush-me/SynthText/issues/comments/390666370","html_url":"https://github.com/ankush-me/SynthText/issues/114#issuecomment-390666370","issue_url":"https://api.github.com/repos/ankush-me/SynthText/issues/114","id":390666370,"user":{"login":"Shun14","id":16732362,"avatar_url":"https://avatars1.githubusercontent.com/u/16732362?v=4","gravatar_id":"","url":"https://api.github.com/users/Shun14","html_url":"https://github.com/Shun14","followers_url":"https://api.github.com/users/Shun14/followers","following_url":"https://api.github.com/users/Shun14/following{/other_user}","gists_url":"https://api.github.com/users/Shun14/gists{/gist_id}","starred_url":"https://api.github.com/users/Shun14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shun14/subscriptions","organizations_url":"https://api.github.com/users/Shun14/orgs","repos_url":"https://api.github.com/users/Shun14/repos","events_url":"https://api.github.com/users/Shun14/events{/privacy}","received_events_url":"https://api.github.com/users/Shun14/received_events","type":"User","site_admin":false},"created_at":"2018-05-21T14:14:47Z","updated_at":"2018-05-21T14:14:47Z","author_association":"NONE","body":"@ankush-me I also have some issue.If I want to generate some straight text rather than curved text, how can I try? I changed some code but get no difference."}}
{"actor":{"display_login":"Shun14"}}