semvec/pypi-packages huggingface dataset:
photorectify 1.1.2
Rectify lens distortions with Lensfun and OpenCV
Requires Python: >=3.7,<3.10
Keywords: gis,image,lensfun,opencv,rectification

# PhoToRectify

**Notice:** Only tested for *Hasselblad L1D-20c* and *Pentax K-1 with HD Pentax-D FA 28-105mm f/3.5-5.6 ED DC WR.*

Undistort images with the [Lensfun](https://lensfun.github.io/) library and [OpenCV](https://opencv.org/).
Multiprocessing is supported to speed up the rectification.

* Allowed input file formats: BMP, JPEG, JPEG 2000, PNG, PIF, SUN RASTERS, TIFF
* Output file formats: JPEG, TIFF
* Currently supported and used compressions:
  + JPEG with Quality 97
  + TIFF with JPEG-Compression
* Custom meta data (optional arguments, use quotes if they contain spaces)

## Installation

Installation into a virtual environment is recommended,
because PhoToRectify depends on some other packages.

Install with: `pip install photorectify`  
Update with: `pip install --upgrade photorectify`

### Requirements

* Python 3.7+
* exiftool 10.38+ (older versions not tested; install it with your distribution’s package manager)
* [PyExifTool](https://github.com/smarnach/pyexiftool) has been modified and is shipped with photorectify’s source code (removed `-n` optional argument for proper lens detection with Lensfun + added method `copy_tags()`)

* For development: [poetry](https://python-poetry.org/) (do not skip the installation of the development dependencies!)

## Alternative remapping method for undistort()

Instead of using Pillow, you can also use OpenCV for remapping.
```
self.img_bgr_undist = lensfunpy.util.remap(
    self.img_blob_bgr,
    undistorted_coords)
```

## Examples

Rectify one photo in a directory (rectifed photo are stored in the same directory as the input file):  
`photorectify Sampledata/DJI_0051.JPG`

Rectify all photos in a directory:  
`photorectify Sampledata/`

Rectify into a custom output directory:  
`photorectify Sampledata/ -o Sampledata/Rectified`

Append custom suffix to rectified photos (automatically adds an underscore):  
`photorectify Sampledata/ -s rect`

Specify meta data if photo hasn’t any EXIF tags:
```
photorectify Sampledata/DJI_0051.JPG \
    --model L1D-20c \
    --make Hasselblad \
    --FLength 10.26 \
    --FNumber 4.5
```

Get version:  
`photorectify --version`

## Development

More cameras and lenses can be supported by
adding them to [`lensfun-db.xml`](https://gitlab.com/archaeohelper/photorectify/-/blob/master/src/photorectify/lensfun-db.xml).
See the [Lensfun database](https://github.com/lensfun/lensfun/tree/master/data/db).

Running tests:  
`poetry run pytest -q tests/test_rectification.py`

## Contribution

To help improving this python package,
open an issue or create a merge request.
efficient-det 0.1.3
Efficient-Det Implementation in Keras
Requires Python: >=3.6, !=3.9.*

## EfficientDet
EfficientDet Implementation in Keras focused on clean code and
readability. 
Training will be logged with Tensorboard. 
To take a look at the training progress do: **tensorboard --logdir logs**
This repo also includes the option of using wandb.ai for experiment tracking.

### Installation

#### Via PIP (recommended)
Split into 3 ways to install. This is due to the way tensorflow needs
to be installed to correctly work with CUDA. The first installation
does not include tensorflow and is recommended to use.

```shell
pip install efficient-det
```


You can include a [cpu] or [gpu] tag to include the respective tensorflow
version.
Includes tensorflow dependency:

#### Via Docker
Runs with tensorflow:2.3.0-gpu.
Depending on system CUDA version you might need to use
another version. [See this for more info](https://www.tensorflow.org/install/source#gpu
).

Install docker and nvidia container toolkit on host system
```shell
sudo apt-get install -y docker.io nvidia-container-toolkit
```

Build Docker Image

```shell
sudo docker build . -t edet
```


#### From Source
1. Clone Repository

```shell
git clone git@git.hhu.de:zeboz100/efficientdet.git
```

2. Build it

```shell
pip install -r requirements.txt
```


### Usage

#### PIP

Training

```shell
python3 -m efficient_det.run_training --dataset_path /path/to/dataset
```

Run a Hyperparameter Search:
```shell
python3 -m efficient_det.run_hyper_parameter_search --dataset_path 
/path/to/dataset --num_tries 100 --gpus_per_trial 0.5
```


#### Source
Execute all commands in **efficientdet/**

Set PYTHONPATH :

```shell
export PYTHONPATH="$PWD/src"
```

Training
```shell
python3 src/efficient_det/train.py --dataset_path /path/to/dataset/
```

Hyperparameter Search:
```shell
python3 src/efficient_det/train.py --dataset_path /path/to/dataset/
```

#### Docker

Run Container
```shell
sudo docker run --gpus all -it edet bash
```

and then proceed with the PIP instructions.

#### To run all tests

```shell
python3 -m unittest
```

#### To test loaded model
You can test the loaded model via notebook or from a script.


* Notebook in examples/visualize_rsults.ipynb

* You need to set dataset path
* You need to set path to trained model
  
Execute Script from efficientdet/
```shell
python3 example/visualize_results.py
```