Comments (3)
Hi @ierezell, thanks for this request! We currently have a seed
arg for some augmentations that include random sampling within them (e.g. change_case
in text https://github.com/facebookresearch/AugLy/blob/main/augly/text/functional.py#L65 or perspective_transform
in image https://github.com/facebookresearch/AugLy/blob/main/augly/image/functional.py#L1719), but it's true that this is missing for some (e.g. insert_punctuation_chars
in text https://github.com/facebookresearch/AugLy/blob/main/augly/text/functional.py#L144).
I will add this to our list of tasks to do soon, to add seed args to all augmentations that involve random sampling which don't already have it.
from augly.
It is good that change_case
has seed argument, but the current implementation means that without specifying the seed, it keeps generating the same result
from augly.
AugLy is cool, however many transformations are not random:
Here is a code snippet to make any transfomation random, (even with the random distributions you preffer):
import numpy as np
import augly.image as imaugs
def random_uniform(min,max):
return lambda: np.random.uniform(min, max)
def random_normal(mean,std):
return lambda: np.random.normal(mean, std)
def randomize(fn_2_randomize, **kwargs):
def randomized_fn(img_pil):
# 1) Compute random_params into fixed_params:
fixed_args = {}
for key_paramName, value_randomFn in kwargs.items():
fixed_args[key_paramName] = value_randomFn()
# 2) Call PIL function with fixed_params
return fn_2_randomize(img_pil, **fixed_args)
return randomized_fn
random_overlay_text = randomize(imaugs.overlay_text,
x_pos=random_uniform(0,0.5),
y_pos=random_uniform(0,0.9))
# Now you can call it :)
random_overlay_text(img)
from augly.
Related Issues (20)
- Augly should use system-installed fonts instead of bundled ones HOT 1
- Move test data out of `augly` dir HOT 2
- boost fb HOT 1
- ReplaceSimilarChars text augmenter removes separators and replaces them with one blank space
- one HOT 1
- Support For Keypoints?
- IMPORTANT: AugLy v1.0.0 release
- Path is invalid
- mosaic
- Issue about not specifying the path to the ffmpeg package
- Missing comparison in paper
- Fixed : SimulateTypo type error
- Paraphrasing using AugLy
- Shape issue in `reverb`
- Error Videogear error HOT 2
- AssertionError: Output path invalid: HOT 1
- Fix for rotating bounding box HOT 3
- failed to find libmagic on M1 Mac
- ModuleNotFoundError
- HelpοΌI will not enhance the corresponding json file of the image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from augly.