semvec/pypi-packages huggingface dataset:
khmerocr-tools 0.13
Khmerocr_tools is a Python library that generates synthetic images containing Khmer text
License: MIT
Requires Python: >=3.8

# Khmerocr_tools | Synthetic Data Generator

## Introduction

The Khmer Text Image Generator is a Python library that generates synthetic images containing Khmer text for use in training optical character recognition (OCR) models. It allows users to customize various aspects of the generated images, such as the text content, font style, background color, and blur effect.

## Features

- Generate synthetic images containing Khmer text
- Customize text content from a file
- Choose from multiple font styles
- Option to apply random blur effect to images
- Generate corresponding labels for each image


## Installation

You can install the Khmer Text Image Generator using pip:

```bash
pip install khmerocr_tools
```


## Usage

- create text file to words list eg. dict.txt and put all khmer words you want to gnerate or download [sample data here](https://github.com/MetythornPenn/khmerocr_tools/blob/main/dict.txt)

- create a folder call font and download all font from this link : [font](https://github.com/MetythornPenn/khmerocr_tools/tree/main/font)

- create python script to generate data eg. test.py
```python
from khmerocr_tools import synthetic_data

# Set parameters
image_height = 128
output_folder = 'output'
output_labels_file = 'output/labels.txt'
text_file_path = "dict.txt"
font_option = [1, 2]  

# Generate images and labels
synthetic_data(
    text_file_path, 
    image_height, 
    output_folder, 
    output_labels_file, 
    font_option=font_option, 
    random_blur=True
)

```

## Parameters

- `image_height`: Height of the generated images in pixels.
- `output_folder`: Path to the folder where generated images will be saved.
- `output_labels_file`: Path to the file where labels will be saved.
- `text_file_path`: Path to the text file containing Khmer text for generation.
- `font_option`: List of integers representing font options. 
  - 1 for AKbalthom KhmerLer Regular.
  - 2 for Khmer MEF1 Regular.
  - 3 for Khmer OS Battambang Regular.
  - 4 for Khmer OS Muol Light Regular.
  - 5 for Khmer OS Siemreap Regular.
  - Use an empty list [] to select all available fonts.
- `random_blur`: Boolean flag indicating whether to apply random blur effect to images.



## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
stochasticclock 0.0.3
Atomic clock simulation
License: MIT
Requires Python: >=3.8
Keywords: Caesium,Metrology,SDE,atomic,clock,stochastic,timer

# stochasticclock

![](https://raw.githubusercontent.com/Mitrxs/Stochastic-clock/main/example_figures/Example_illustration.png)

A module calculating the stochastic deviations in timepoints for atomic clocks. 

This module is an application of the theory presented in Galleani et al. (2003), doi:10.1088/0026-1394/40/3/305.

The module's current functionality calculates stochastic deviations using the exact iterative solution to the stochastic differential equation in `Galleani_exact()`

$$\begin{equation*}
    \mathbf{X}(t_{n+1}) =
        \begin{pmatrix}
            1 & \delta t \\\ 
            0 & 1 
        \end{pmatrix}
    \mathbf{X}(t_n) +
        \begin{pmatrix}
            \delta t \mu_1 + \frac{1}{2} \delta t^2 \mu_2 \\\ 
            \delta t \mu_2
        \end{pmatrix} 
    + \mathbf{\Sigma}(t_n)
\end{equation*}$$ 

$$\begin{equation*}
    \mathbf{\Sigma}(t_n) \sim \mathcal{N} \bigg( \mathbf{0},
        \begin{bmatrix}
            \sigma_1^2 \delta t + \frac{1}{3} \sigma_2^2 \delta t^3 & \frac{1}{2}\sigma_2^2 \delta t^2 \\\ 
            \frac{1}{2}\sigma_2^2 \delta t^2 & \sigma_2^2 \delta t 
        \end{bmatrix} 
    \bigg)
\end{equation*}$$ 

Stochastic deviations can be visualised using `clock_error()`, and their distributions simulated with `deviation_distribution()`.

Please consult the Jupyter notebook for a walkthrough of the package.