Comments (3)
HorizontalFlip with points_flip parameter is not fully support now, in my todo list.
for now, you might need to let points_flip as constant list or indices array within your custom function and use torchlm.bind to bind it togather into the transform pipeline
# First, defined your custom functions
def callable_array_noop(img: np.ndarray, landmarks: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
# do some transform here
points_flips = [] # or array ...
return img.astype(np.uint32), landmarks.astype(np.float32)
# Then, bind your functions and put it into the transforms pipeline.
transform = torchlm.LandmarksCompose([
torchlm.bind(callable_array_noop, bind_type=torchlm.BindEnum.Callable_Array),
])
See data-augmentation for more details.
from torchlm.
Is possible to use Albumentations?
from torchlm.
sure, torchlm have add a soft-support for Albumentations, data-augmentation will show you the details of how to bind transforms from Albumentations.
NOTE: Please install albumentations first if you want to bind albumentations's transforms. If you have the conflict problem between different installed version of opencv (opencv-python and opencv-python-headless, ablumentations
need opencv-python-headless). Please uninstall the opencv-python and opencv-python-headless first, and then reinstall albumentations. See albumentations#1140 for more details.
# first uninstall conflict opencvs
pip uninstall opencv-python
pip uninstall opencv-python-headless
pip uninstall albumentations # if you have installed albumentations
pip install albumentations # then reinstall albumentations, will also install deps, e.g opencv
Then, check if albumentations is available.
torchlm.albumentations_is_available() # True or False
transform = torchlm.LandmarksCompose([
torchlm.bind(torchvision.transforms.GaussianBlur(kernel_size=(5, 25)), prob=0.5),
torchlm.bind(albumentations.ColorJitter(p=0.5))
])
from torchlm.
Related Issues (20)
- update torchlm v0.1.6.1 to pypi
- fixed deps miss of scipy for metrics
- is PIPNet the SOTA ? HOT 4
- Inference on PyTorch Backend not work HOT 5
- Missing mobilenet_v2 model file HOT 7
- 关于在装甲板检测中的相关问题 HOT 2
- Can't use cuda in pipnet HOT 15
- Wrong results while running on GPU
- 如何让掩码和图片增强之后一样
- Error on Converting 300W dataset in class Landmarks300WConverter with message UFuncTypeError: Cannot cast ufunc 'subtract' output...
- Training with 7 landmarks
- Will PipNet allow gradients to flow through?
- Wrong results with Faceboxesv2 (ONNX) and there isn't YoloV5face implemented yet. HOT 2
- Inference - Getting non-normalized landmarks
- Fine-tuning Custom Dataset Error HOT 1
- 旋转变换后的图像尺度变化问题
- 控制台会自动输出小数 HOT 5
- How to output forehead's landmark
- 不能训练起来,并没有详细解释怎么准备数据。我已经下载了
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 torchlm.