Helpful utilities for python development
Project description
frills 1.0.4
Helpful utilities for python development
Requires:
- python 3.9
- cv2 4.9.0.80
- numpy 1.24.3
maths
get_factors()
takes one argumentn
and returns all factors ofn
. This is useful for picking appropriate batch sizes in custom data loaders.
graphics
All show functions take the arguments message
and image
for the window title and image to be displayed.
-
showw()
waits for user input (any key) before continuing execution. This is useful for checking through a series of images, allowing the user to skip as quickly or slowly as they want. -
showx()
shows the specified image, then exits the program entirely once the cv2 window is closed. This is useful for checking the contents of an image dataset are as expected without having to manually halt further execution.
debugging
-
printw()
prints a string built from the arguments given and waits for used input (any key) before continuing execution. This is useful for stepping through a program slowly and analysing the contents of variables one at a time. -
printx()
prints a string built from the arguments given, then exits the program entirely. This is useful for checking the contents of a variable and breaking there, rather than having to comment the rest of the code or usesys.exit()
underneath aprint()
. -
normalize_to_range()
takes the following arguments:x
the data (expected to be a numpy array)min_orig
the original lower bound of the datamax_orig
the original upper bound of the datamin_new
the minimum of the new scalemax_new
the maximum of the new scale
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file frills-1.0.4.tar.gz
.
File metadata
- Download URL: frills-1.0.4.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1bfaae6f6c58cfe2dfac403f82df944e43d9ac002b262b58b19a6a77df9f31 |
|
MD5 | 76e9f7d3b53bd4d049db3a2211999806 |
|
BLAKE2b-256 | f3cca96d12a598d7eaac4ebdcc1c50e90b243417ab94d034cedb43c874fd66f2 |
File details
Details for the file frills-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: frills-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de47c734e1a1c7ed29a3b92c666d766e38f63c17ee9e403b7923431671e3c28b |
|
MD5 | faa414dab2787e7a5715c8b626cf2bd8 |
|
BLAKE2b-256 | 3e42ce2768526447b9083734127af251a1070e25c5752d70ca0890149a93d071 |