Refactoring: Rename

This commit is contained in:
Matthias Bisping 2023-02-15 18:52:57 +01:00
parent 0f6e87b8a6
commit 0e7791394f
15 changed files with 18 additions and 15 deletions

View File

@ -10,7 +10,7 @@ from cv_analysis.utils.geometric import is_square_like
from cv_analysis.utils.merging import merge_related_rectangles from cv_analysis.utils.merging import merge_related_rectangles
from cv_analysis.utils.postprocessing import remove_included, remove_overlapping from cv_analysis.utils.postprocessing import remove_included, remove_overlapping
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.random import rnd from synthesis.randomization import rnd
from synthesis.segment.content_rectangle import ContentRectangle from synthesis.segment.content_rectangle import ContentRectangle
from synthesis.segment.recursive_content_rectangle import RecursiveContentRectangle from synthesis.segment.recursive_content_rectangle import RecursiveContentRectangle
from synthesis.segment.segments import ( from synthesis.segment.segments import (

View File

@ -5,7 +5,7 @@ from PIL import Image
from funcy import lflatten from funcy import lflatten
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.random import rnd from synthesis.randomization import rnd
class PagePartitioner(abc.ABC): class PagePartitioner(abc.ABC):

View File

@ -1,6 +1,6 @@
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.partitioner.page_partitioner import PagePartitioner from synthesis.partitioner.page_partitioner import PagePartitioner
from synthesis.random import rnd from synthesis.randomization import rnd
class RandomPagePartitioner(PagePartitioner): class RandomPagePartitioner(PagePartitioner):

View File

@ -1,6 +1,6 @@
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.partitioner.page_partitioner import PagePartitioner from synthesis.partitioner.page_partitioner import PagePartitioner
from synthesis.random import rnd from synthesis.randomization import rnd
class TwoColumnPagePartitioner(PagePartitioner): class TwoColumnPagePartitioner(PagePartitioner):

View File

@ -13,6 +13,9 @@ random_seed = random.randint(0, 2**32 - 1)
# 2467967671 # 2467967671
# random_seed = 237553299
# random_seed = 1021421466
logger.info(f"Random seed: {random_seed}") logger.info(f"Random seed: {random_seed}")
rnd = random.Random(random_seed) rnd = random.Random(random_seed)

View File

@ -11,7 +11,7 @@ from matplotlib.colors import ListedColormap
from cv_analysis.utils.geometric import is_square_like, is_wide, is_tall from cv_analysis.utils.geometric import is_square_like, is_wide, is_tall
from cv_analysis.utils.image_operations import superimpose from cv_analysis.utils.image_operations import superimpose
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.random import rnd, probably, maybe from synthesis.randomization import rnd, probably, maybe
from synthesis.segment.random_content_rectangle import RandomContentRectangle from synthesis.segment.random_content_rectangle import RandomContentRectangle
from synthesis.text.text import generate_random_words from synthesis.text.text import generate_random_words

View File

@ -1,6 +1,6 @@
import random import random
from synthesis.random import get_random_seed from synthesis.randomization import get_random_seed
from synthesis.segment.content_rectangle import ContentRectangle from synthesis.segment.content_rectangle import ContentRectangle

View File

@ -1,5 +1,5 @@
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.random import probably, rnd from synthesis.randomization import probably, rnd
from synthesis.segment.content_rectangle import ContentRectangle from synthesis.segment.content_rectangle import ContentRectangle
from synthesis.segment.plot import RandomPlot from synthesis.segment.plot import RandomPlot
from synthesis.segment.text_block import TextBlock from synthesis.segment.text_block import TextBlock

View File

@ -13,7 +13,7 @@ from cv_analysis.utils.geometric import is_square_like
from cv_analysis.utils.image_operations import superimpose from cv_analysis.utils.image_operations import superimpose
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from cv_analysis.utils.spacial import area from cv_analysis.utils.spacial import area
from synthesis.random import rnd, possibly from synthesis.randomization import rnd, possibly, maybe
from synthesis.segment.content_rectangle import ContentRectangle from synthesis.segment.content_rectangle import ContentRectangle
from synthesis.segment.plot import pick_colormap from synthesis.segment.plot import pick_colormap
from synthesis.segment.random_content_rectangle import RandomContentRectangle from synthesis.segment.random_content_rectangle import RandomContentRectangle
@ -50,7 +50,7 @@ class RecursiveRandomTable(RandomContentRectangle, RecursiveContentRectangle):
self.content = Image.new("RGBA", (self.width, self.height), (255, 255, 255, 0)) self.content = Image.new("RGBA", (self.width, self.height), (255, 255, 255, 0))
self.background_color = get_random_background_color() self.background_color = maybe() and get_random_background_color() or (255, 255, 255, 0)
self.layout = layout or self.pick_random_layout() self.layout = layout or self.pick_random_layout()
logger.debug(f"Layout: {self.layout}") logger.debug(f"Layout: {self.layout}")

View File

@ -7,7 +7,7 @@ from PIL import Image, ImageDraw, ImageFont
from funcy import lmap, complement, keep, first, lzip, omit, project from funcy import lmap, complement, keep, first, lzip, omit, project
from loguru import logger from loguru import logger
from synthesis.random import rnd from synthesis.randomization import rnd
class RandomFontPicker: class RandomFontPicker:

View File

@ -1,7 +1,7 @@
from funcy import identity, compose, first, juxt, rest, rcompose from funcy import identity, compose, first, juxt, rest, rcompose
from cv_analysis.utils import star, rconj from cv_analysis.utils import star, rconj
from synthesis.random import rnd from synthesis.randomization import rnd
from synthesis.text.line_formatter.line_formatter import LineFormatter from synthesis.text.line_formatter.line_formatter import LineFormatter

View File

@ -2,7 +2,7 @@ import random
from faker import Faker from faker import Faker
from synthesis.random import rnd from synthesis.randomization import rnd
def generate_random_words(n_min, n_max): def generate_random_words(n_min, n_max):

View File

@ -1,7 +1,7 @@
from funcy import first, rest from funcy import first, rest
from cv_analysis.utils import conj from cv_analysis.utils import conj
from synthesis.random import rnd from synthesis.randomization import rnd
from synthesis.text.text_block_generator.paragraph import generate_random_text_lines from synthesis.text.text_block_generator.paragraph import generate_random_text_lines
from synthesis.text.text_block_generator.text_block_generator import TextBlockGenerator from synthesis.text.text_block_generator.text_block_generator import TextBlockGenerator
from synthesis.text.line_formatter.identity import IdentityLineFormatter from synthesis.text.line_formatter.identity import IdentityLineFormatter

View File

@ -7,7 +7,7 @@ from funcy import iterate, take, last
from cv_analysis.logging import debug_log from cv_analysis.logging import debug_log
from cv_analysis.utils import star from cv_analysis.utils import star
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.random import rnd from synthesis.randomization import rnd
from synthesis.text.line_formatter.identity import IdentityLineFormatter from synthesis.text.line_formatter.identity import IdentityLineFormatter
from synthesis.text.line_formatter.line_formatter import LineFormatter from synthesis.text.line_formatter.line_formatter import LineFormatter
from synthesis.text.line_formatter.paragraph import ParagraphLineFormatter from synthesis.text.line_formatter.paragraph import ParagraphLineFormatter

View File

@ -14,7 +14,7 @@ from cv_analysis.utils.image_operations import blur, sharpen, overlay, superimpo
from cv_analysis.utils.rectangle import Rectangle from cv_analysis.utils.rectangle import Rectangle
from synthesis.content_generator import ContentGenerator from synthesis.content_generator import ContentGenerator
from synthesis.partitioner.two_column import TwoColumnPagePartitioner from synthesis.partitioner.two_column import TwoColumnPagePartitioner
from synthesis.random import rnd from synthesis.randomization import rnd
from synthesis.segment.table.table import paste_contents from synthesis.segment.table.table import paste_contents