semvec/pypi-packages huggingface dataset:
pexels-api 1.0.1
Use Pexels API v1 with Python
Keywords: pexels api images photos

# Using Pexels API v1 with Python
Use *[pexels_api][2]* to search photos from [Pexels][0].
## Dependencies:
- [requests][1]

## Installation:
`pip install pexels-api`

## Usage:
The following code shows you how to import the package and make a simple query to Pexels API v1. See more [examples][4] or the [documentation][3].
```python
# Import API class from pexels_api package
from pexels_api import API
# Type your Pexels API
PEXELS_API_KEY = 'YOUR-PEXELS-API-KEY'
# Create API object
api = API(PEXELS_API_KEY)
# Search five 'kitten' photos
api.search('kitten', page=1, results_per_page=5)
# Get photo entries
photos = api.get_entries()
# Loop the five photos
for photo in photos:
  # Print photographer
  print('Photographer: ', photo.photographer)
  # Print url
  print('Photo url: ', photo.url)
  # Print original size url
  print('Photo original size: ', photo.original)
```

<!-- References -->
[0]: https://pexels.com                        "Pexels website"
[1]: https://2.python-requests.org/en/master/  "Documentation: requests"
<!-- Documentation -->
[2]: https://github.com/AguilarLagunasArturo/pexels-api               "Source code on Github"
[3]: https://github.com/AguilarLagunasArturo/pexels-api#documentation "Documentation: pexels_api"
[4]: https://github.com/AguilarLagunasArturo/pexels-api#examples      "Examples"
segview 0.3.0
A pure Python module for visualising 3D segmentation results
Requires Python: >=2.7

# SegView

visualise the 3D segmentation result

## Install

- The most convenient way would be: `pip3 install segview`
- You can also Include the file `segview.py` in your project directory

(SegView only support Python 3.5+, because it requires `PyQt5`)

## Use SegView

```python
segview.render_label(label, metadata, alpha=1) # see the 3D model of labels

segview.annotate_label(image, label, axis=-1)  # see the 2D slice with labels along different axes

segview.render_image(image, metadata)  # see the 3D render of an image

segview.render_image(image, metadata, feature)  # see the 3D image with features

segview.annotate_feature(image, label)  # see 2D slice with features
```

- `label` is a 3D `numpy` array
    - Usually it is the result of image segmentation, having the same structure
    - Value `0` corresponds to the background
    - Its shape is `(x, y, z)`.
- `feature` is a 2D `numpy` array
    - Usually it is the result of intensity maxima locating
    - It is 3D positions, `[(x1, y1, z1), (x2, y2, z2), ...]`
    - Its shape is `(feature_number, 3)`
- `metadata` is a dictionary containing the voxel size
    - It is only used in 3D visualisation, as many z-stack images have lower resolutions along z-axis
    - `{'voxel_size_x': 1, 'voxel_size_y': 1, 'voxel_size_z': 1}`
- `alpha` adjusts the brightness of the result