semvec/pypi-packages huggingface dataset:
selfdiffusion 0.1.7
Easily create datasets for diffusion models personalization
Requires Python: >=3.10,<4.0

<p align="center" text-align="center">
  <img src="https://raw.githubusercontent.com/La-Compagnie-Infonuagique/selfdiffusion/aca5dc131f3162c2a0817a38a7d95b836a7faefc/assets/selfdiffusion.jpg" alt="self diffusion">
</p>

<div align="center">
  <h1>selfdiffusion</h1>
</div>

<p align="center">
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-green.svg"></a>
  <a href="https://pypi.org/project/selfdiffusion/"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/selfdiffusion.svg"></a>
</p>


selfdiffusion is a CLI tool that helps you prepare training datasets of 
*portrait* images for 
[stable diffusion](https://en.wikipedia.org/wiki/Stable_Diffusion) model
fine tuning.  

selfdiffusion takes as input images of different sizes and uses an empirical
heuristic to extract the subject of the image and create a version of it that 
fits the native resolution of the model you want to fine-tune.

## Getting started
install the CLI tool with pip:
```bash
pip install selfdiffusion
```

## Usage
Start by assembling a set of images that contains the single subject you want
to fine tune the model on. If you don't have such a
dataset, we provide the utiliy bing command to download images from the internet into a target folder:

```bash
selfdiffusion bing "portrait of a person" --target /path/to/target/folder --limit 20
```

this will download 20 images of people from bing and store them in the /path/to/target/folder.

Once you have your starting images, extract portraits suitable for fine tuning with the following command:

```bash
# 512x512 is ideal for fine-tuning runwayml/stable-diffusion-v1-5
selfdiffusion person /path/to/input/images /path/to/output/images --resolution 512 512
```

you can find out more about model fine tuning in the exemples folder of the [diffusers](https://github.com/huggingface/diffusers) repository. 

### Notes
selfdiffusion will produce an output image for every input image given that:

1. The input image as a resolution that is greater then the requested output resolution in both dimensions.

2. There is a single person in your image, as determined by [yolov8](https://github.com/ultralytics/ultralytics)
and it's face is the only one in the image, as determined by [face_recognition](https://github.com/ageitgey/face_recognition).

Sometimes, selfdiffusion will filter out an image that very evidently
contains a single subject and it's face. If you absolutely want to have this image in your dataset, we suggest using a tool like [Birme](https://www.birme.net) for capturing the subject and resizing to the native model resolution.

## Author
Jonathan Pelletier.
django-transactional-mail 0.3.1
Transactional emails in Django projects made easy

## Requirements
* `django` >= 2.2

## Quick Start
Install `django-transactional-mail`
```
pip install django-transactional-mail
```
Add `transactional_mail` to `INSTALLED_APPS` in your project's `settings.py`.

```python
INSTALLED_APPS = (
    ...
     'transactional_mail',
    ...
)
```

Run migrations in your project to create the models for the CMS app.

```
./manage.py migrate transactional_mail
```


## Distributing and update

Build an sdist to ensure that the templates are included:

```
python -m build --sdist
```

Publish to pypi

```
python3 -m twine upload dist/*
```
panacotta 0.2
Python API for controlling Panasonic Blu-Ray players

Python control for Panasonic Blu-Ray players
============================================

This is a simple Python API for controlling Panasonic Blu-Ray players. It has only been tested with the DMP-BDT220, which dates from 2012. All players supported by the [Panasonic Blu-ray Remote 2012 Android app](https://play.google.com/store/apps/details?id=com.panasonic.avc.diga.blurayremote2012) should be supported; i.e. DMP-BDT120, DMP-BDT220, DMP-BDT221, DMP-BDT320, DMP-BDT500 and DMP-BBT01 devices.

Newer players with "UB" prefixes (e.g. the UB-9000) support a (very) limited set of functions.

Example use
-----------

Connect to a player on 192.168.0.4 and find out the current playing status:

```
import panacotta

bluray = panacotta.PansonicBD('192.168.0.4')
print("Device is currently %s" % bluray.get_play_status()[0])
```

Note that the device must be on the same subnet as the host running this API; requests from a different subnet will return a failure.

Press the power button:

```
import panacotta

bluray = panacotta.PansonicBD('192.168.0.4')
bluray.send_key('POWER')
```
textfiles 0.0.7
Managing the text files txt, csv and json
Keywords: python,text,file,csv,json,txt


# TextFiles v0.0.7
A convenient Python API for working with the text files CSV, JSON, TXT

The library allows handling csv, txt and json files easily from within Python.

## Installation
```terminal
pip install textfiles
```

## How to use:

Import TextFile: Once you install the library you can import the TextFile class into your Python code. To do this, simply add the following line to your code:

```python
from textfiles.file_factory import TextFile
```

Use TextFile: You can now use the TextFile class to create instances of CsvFile, TxtFile, and JsonFile classes. The factory has two methods:

make_file_instance: This method creates an instance of the file class for an existing text file.

make_file: This method creates a new file and a corresponding Python instance of it.

To create an instance of a CsvFile, TxtFile, or JsonFile class, simply call the appropriate static method and pass in the necessary parameters. The factory will then return an instance of the appropriate class.

Examples: Here are some examples of how to use TextFile:

To create an instance of an existing file:

```python
file = TextFile.make_file_instance('csv', 'path/to/file.csv', has_header=True, delimiter=',')
file = TextFile.make_file_instance('txt', 'path/to/file.txt')
file = TextFile.make_file_instance('json', 'path/to/file.json')
```

To create a new file:

```python
file = TextFile.make_file('csv', 'path/to/file.csv', ['Header1', 'Header2'])
file = TextFile.make_file('txt', 'path/to/file.txt')
file = TextFile.make_file('json', 'path/to/file.json')
```
Note - When creating a CSV file, it is mandatory to pass a header.

### Main functions:
```python
    self.get_content()
    self.search()
    self.count()
```

### examples:

#### CsvFile.update_cell()
```python
    my_csv = CsvFile('/path/to/my/csv/file.csv')
    my_csv.update_cell(column=3, row=2, value='New content')
```

#### JsonFile.search()
```python
    with open ("example.json", "w") as f:
        json.dump(f, {"State": "New York", "cities": ["New York", "Albeny", "New Paltz"]})


    my_json = JsonFile('/path/to/my/json/file.json')
    new = my_json.search("new")
    print(new)
```

output:
```python
[{'State': 'New York'}, {'cities': [{'index[0]': 'New York'}, {'index[2]': 'New Paltz'}]}]
```