Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S SynthText
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Ankush Gupta
  • SynthText
  • Merge requests
  • !155

Output text masks, upgrade dependencies, improved code and docs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Viacheslav Shalamov requested to merge github/fork/sslavian812/python3 into python3 May 05, 2019
  • Overview 8
  • Commits 11
  • Pipelines 1
  • Changes 8

Hi there!

In my research, I needed to use your project to generate some images with texts along with masks, labels and bounding boxes. I added some new features to it, and here is my PR:

  • made this code compatible with mac OS (it was impossible to satisfy dependencies, a lot of problems with pyplot and others)
  • removed deprecated api calls: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.hold.html pyplot.hold(True) - works by default since version 3.0 (and the method is removed), scipy.misc.imsave - replaced with recommended imageio.imwrite)
  • updated requirements.txt
  • improved code formatting (used auto-formatting tool)
  • improved and added more of documentation. Used docstrings style by Google. See this for different formats examples https://stackoverflow.com/a/24385103/2877029
  • implemented a new feature: with --output-masks flag users can obtain text masks used to place text to the image (see "_mask.png" files), and bounding boxes of each word with a label (see "_bb.txt" files). Run with this flag and see the content of "./masks/" folder for more examples
  • moved output visualization (--viz flag) out of renderer - no need to propagate this flag to renderer logic: Following the single responsibility principle: renderer should render, a generator should generate (and, optionally, display result for users)
  • added debug logs and --debug flag, which enables more logs to be printed. Tested combinations "--viz --debug" "--viz --output-masks", "--viz --output-masks --debug" "--output-masks --debug".

Let's work together on merging this contribution to your project.

Btw, I'd very much encourage you to make it python3 by default.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/sslavian812/python3