semvec/pypi-packages huggingface dataset:
cutmix-keras 1.0.0
CutMuxImageDataGenerator For Keras
License: MIT
Keywords: cutmix,keras

# CutMixImageDataGenerator (Keras)

![GitHub release (latest by date)](https://img.shields.io/github/v/release/DevBruce/CutMixImageDataGenerator_For_Keras)

> Paper: [CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features](https://arxiv.org/abs/1905.04899)

<br>

## Install

```bash
$ pip install cutmix-keras
```

<br>

## How To Use

```python
class CutMixImageDataGenerator():
    def __init__(self, generator1, generator2, img_size, batch_size):
        self.batch_index = 0
        self.samples = generator1.samples
        self.class_indices = generator1.class_indices
        self.generator1 = generator1
        self.generator2 = generator2
        . . .
```

- `generator1`, `generator2` need same generator applied `flow` method

<br>

- `generator1`, `generator2` need `shuffle=True`  
If `shuffle=False`, This generator cutmix with same images.  
So there would no augmentation

<br>

- Why are there two same generators? (`generator1`, `generator2`)  
\-\-\> To Solve Reference Problem  

<br>

### Using Example

```python
# (some codes) ...
from cutmix_keras import CutMixImageDataGenerator  # Import CutMix


train_datagen = ImageDataGenerator(
    rescale=1./255,
)

train_generator1 = train_datagen.flow_from_dataframe(
    dataframe=X_train,
    directory=IMG_DIR,
    target_size=(IMG_SIZE, IMG_SIZE),
    x_col='X_Column',
    y_col='Y_Column',
    color_mode='rgb',
    class_mode='categorical',
    batch_size=BATCH_SIZE,
    shuffle=True,  # Required
)

train_generator2 = train_datagen.flow_from_dataframe(
    dataframe=X_train,
    directory=IMG_DIR,
    target_size=(IMG_SIZE, IMG_SIZE),
    x_col='X_Column',
    y_col='Y_Column',
    color_mode='rgb',
    class_mode='categorical',
    batch_size=BATCH_SIZE,
    shuffle=True,  # Required
)

# CutMixImageDataGenerator
train_generator = CutMixImageDataGenerator(
    generator1=train_generator1,
    generator2=train_generator2,
    img_size=IMG_SIZE,
    batch_size=BATCH_SIZE,
)
```
pyhtmlconv 1.3
pyhtmlconv: html converter (image / pdf)
License: MIT
Keywords: html screenshot wkhtmltopdf converter image png jpeg pdf

pyhtmlconv: html converter (image / pdf)
----------------------------------------

python html converter (image / pdf)

Installation
------------

Anda perlu menginstall `wkhtmltopdf <https://wkhtmltopdf.org/>`_, sebelum menginstall modul ini.

.. code-block:: bash

    pip install pyhtmlconv

Example
-------

.. code-block:: python

    import pyhtmlconv as html
    url = "https://google.com"
    image = html.convert_to_image(url, "jpeg")
    with open("test_image.jpeg", "wb") as fp:
        fp.write(image)

    pdf = html.convert_to_pdf(url)
    with open("test_file.pdf") as fp:
        fp.write(pdf)

Anda juga dapat mengkonversikan data (image atau pdf) ke bentuk `data uri <https://tools.ietf.org/html/rfc2397>`_ dengan cara menambahkan nilai ``True`` pada parameter ``datauri`` di fungsi ``convert_to_image`` atau ``convert_to_pdf``.