Skip to content

Commit dccbcfe

Browse files
authored
Merge pull request #16 from DefTruth/dev
feat(pypi): update torchlm to pypi v0.1.3 (#16)
2 parents 56c260d + 3a09f80 commit dccbcfe

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ debug.py
55
build
66
dist
77
torchlm.egg-info
8-
*.sh
8+
*.sh
9+
./data

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
def get_long_description():
8-
description = (PATH_ROOT / "docs/README.md").read_text(encoding="utf-8")
8+
description = (PATH_ROOT / "README.md").read_text(encoding="utf-8")
99
# replace relative repository path to absolute link to the release
1010
static_url = f"https://github.com/DefTruth/torchlm/blob/main/"
1111
description = description.replace("docs/res/", f"{static_url}/docs/res/")
1212
return description
1313

1414
setuptools.setup(
1515
name="torchlm",
16-
version="0.1.2",
16+
version="0.1.3",
1717
author="DefTruth",
1818
author_email="qyjdef@163.com",
1919
description="A PyTorch landmarks-only library with 100+ data augmentations, "

torchlm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Versions
2-
__version__ = '0.1.2'
2+
__version__ = '0.1.3'
33
# Transforms Module: 100+ transforms available, can bind torchvision and
44
# albumentations into torchlm pipeline with autodtype wrapper.
55
from .transfroms import *

torchlm/data/_300w.py

Whitespace-only changes.

torchlm/data/_aflw.py

Whitespace-only changes.

torchlm/data/_cofw.py

Whitespace-only changes.

torchlm/data/_wflw.py

Whitespace-only changes.

torchlm/transfroms/transforms.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ def __call__(
807807
self.scale_y = scale_y
808808

809809
if len(new_landmarks) != num_landmarks:
810+
self.flag = False
810811
raise F.Error('LandmarksResize: {0} input landmarks, but got {1} output '
811812
'landmarks'.format(num_landmarks, len(new_landmarks)))
812813

@@ -957,6 +958,7 @@ def __call__(
957958
self.scale_y = (1 / scale_factor_y)
958959

959960
if len(new_landmarks) != num_landmarks:
961+
self.flag = False
960962
raise F.Error('LandmarksAlign: {0} input landmarks, but got {1} output '
961963
'landmarks'.format(num_landmarks, len(new_landmarks)))
962964

@@ -1038,6 +1040,7 @@ def __call__(
10381040
self.scale_y = (1 / scale_factor_y)
10391041

10401042
if len(new_landmarks) != num_landmarks:
1043+
self.flag = False
10411044
raise F.Error('LandmarksAlign: {0} input landmarks, but got {1} output '
10421045
'landmarks'.format(num_landmarks, len(new_landmarks)))
10431046

@@ -1114,6 +1117,7 @@ def __call__(
11141117
ly_max = np.max(new_landmarks[:, 1])
11151118

11161119
if any((lx_min < 0., lx_max > crop_width, ly_min < 0., ly_max > crop_height)):
1120+
self.flag = False
11171121
return img.astype(np.uint8), landmarks
11181122

11191123
new_img = img[y1:y2, x1:x2, :].copy()
@@ -1255,6 +1259,7 @@ def __call__(
12551259
self.scale_y = resize_scale_y
12561260

12571261
if len(new_landmarks) != num_landmarks:
1262+
self.flag = False
12581263
raise F.Error('LandmarksRandomScale: {0} input landmarks, but got {1} output '
12591264
'landmarks'.format(num_landmarks, len(new_landmarks)))
12601265

@@ -1344,6 +1349,7 @@ def __call__(
13441349
img_h=new_img.shape[0])
13451350

13461351
if len(new_landmarks) != num_landmarks:
1352+
self.flag = False
13471353
raise F.Error('LandmarksRandomTranslate: {0} input landmarks, but got {1} '
13481354
'output landmarks'.format(num_landmarks, len(new_landmarks)))
13491355

@@ -1430,6 +1436,7 @@ def __call__(
14301436
self.scale_y = (1 / scale_factor_y)
14311437

14321438
if len(new_landmarks) != num_landmarks:
1439+
self.flag = False
14331440
raise F.Error(
14341441
'LandmarksRandomRotate: {0} input landmarks, but got {1} output '
14351442
'landmarks'.format(num_landmarks, len(new_landmarks))
@@ -1512,6 +1519,7 @@ def __call__(
15121519
self.scale_y = 1.
15131520

15141521
if len(new_landmarks) != num_landmarks:
1522+
self.flag = False
15151523
raise F.Error(
15161524
'LandmarksRandomShear: {0} input landmarks, but got {1} output '
15171525
'landmarks'.format(num_landmarks, len(new_landmarks))
@@ -1848,7 +1856,7 @@ def __call__(
18481856
patch = F.select_patch(patch_h=new_patch_h, patch_w=new_patch_w,
18491857
patches_paths=self._patches_paths)
18501858
if patch is None:
1851-
self.flag = True
1859+
self.flag = False
18521860
img.astype(np.uint8), landmarks.astype(np.float32)
18531861

18541862
new_img, patch_corner = F.apply_patch(img=img, patch=patch)
@@ -1911,7 +1919,7 @@ def __call__(
19111919
patch = F.select_patch(patch_h=new_patch_h, patch_w=new_patch_w,
19121920
patches_paths=self._patches_paths)
19131921
if patch is None:
1914-
self.flag = True
1922+
self.flag = False
19151923
img.astype(np.uint8), landmarks.astype(np.float32)
19161924

19171925
alpha = np.random.uniform(0.1, self._alpha)
@@ -1961,7 +1969,7 @@ def __call__(
19611969
)
19621970

19631971
if background is None:
1964-
self.flag = True
1972+
self.flag = False
19651973
return img.astype(np.uint8), landmarks.astype(np.float32)
19661974

19671975
new_img = F.apply_background_with_alpha(img=img, background=background, alpha=alpha)
@@ -2008,7 +2016,7 @@ def __call__(
20082016
)
20092017

20102018
if background is None:
2011-
self.flag = True
2019+
self.flag = False
20122020
return img.astype(np.uint8), landmarks.astype(np.float32)
20132021

20142022
new_img = F.apply_background(img=img, background=background)

0 commit comments

Comments
 (0)