You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

targetran

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

targetran - pypi Package Compare versions

Comparing version
0.11.6
to
0.10.4
+2
-2
PKG-INFO
Metadata-Version: 2.1
Name: targetran
Version: 0.11.6
Version: 0.10.4
Summary: Target transformation for data augmentation in objection detection

@@ -11,3 +11,3 @@ Home-page: https://github.com/bhky/targetran

Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Requires-Python: >=3.7
Description-Content-Type: text/markdown

@@ -14,0 +14,0 @@ License-File: LICENSE

@@ -17,6 +17,6 @@ [metadata]

packages = find:
python_requires = >=3.8
python_requires = >=3.7
install_requires =
opencv-python
numpy>=1.22.0
numpy>=1.21.0

@@ -23,0 +23,0 @@ [options.package_data]

Metadata-Version: 2.1
Name: targetran
Version: 0.11.6
Version: 0.10.4
Summary: Target transformation for data augmentation in objection detection

@@ -11,3 +11,3 @@ Home-page: https://github.com/bhky/targetran

Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Requires-Python: >=3.7
Description-Content-Type: text/markdown

@@ -14,0 +14,0 @@ License-File: LICENSE

opencv-python
numpy>=1.22.0
numpy>=1.21.0

@@ -1,3 +0,3 @@

__version__ = "0.11.6"
__version__ = "0.10.4"
__author__ = "Bosco Yung"
__license__ = "MIT"

@@ -65,14 +65,14 @@ """

if limit_open_interval is None:
if not input_range[0] < input_range[1]:
if not input_range[0] <= input_range[1]:
raise ValueError(
f"The {input_name} should be provided as "
f"(min_value, max_value), where min_value < max_value."
f"(min_value, max_value), where min_value <= max_value."
)
return
lower_limit, upper_limit = limit_open_interval
if not lower_limit < input_range[0] < input_range[1] < upper_limit:
if not lower_limit < input_range[0] <= input_range[1] < upper_limit:
raise ValueError(
f"The {input_name} should be provided as "
f"(min_value, max_value), "
f"where {lower_limit} < min_value < max_value < {upper_limit}."
f"where {lower_limit} < min_value <= max_value < {upper_limit}."
)

@@ -25,3 +25,3 @@ """

def _np_range(start: int, end: int, step: int) -> NDIntArray:
return np.arange(start, end, step, dtype=np.int32)
return np.arange(start, end, step, dtype=np.int32) # type: ignore

@@ -34,7 +34,7 @@

def _np_round_to_int(x: NDAnyArray) -> NDIntArray:
return np.rint(x.astype(dtype=np.float32)).astype(dtype=np.int32)
return np.rint(x.astype(dtype=np.float32)).astype(dtype=np.int32) # type: ignore
def _np_logical_and(x: NDBoolArray, y: NDBoolArray) -> NDBoolArray:
return np.logical_and(x, y)
return np.logical_and(x, y) # type: ignore

@@ -54,3 +54,3 @@

)
return np.pad(image, pad_width=pad_width, constant_values=0)
return np.pad(image, pad_width=pad_width, constant_values=0) # type: ignore

@@ -57,0 +57,0 @@

@@ -52,3 +52,3 @@ """

_np_pad_image, _np_range, _np_cast_to_int, _np_round_to_int, np.repeat,
np.tile, # type: ignore
np.tile,
np.ones_like, np.stack, np.concatenate, np.matmul,

@@ -264,3 +264,3 @@ np.clip, np.floor, np.ceil, _np_gather_image,

self._interpolation = interpolation
self._identity_mat = np.expand_dims(np.array([
self._identity_mat = np.expand_dims(np.array([ # type: ignore
[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]

@@ -289,6 +289,6 @@ ]), axis=0)

conditions = np.reshape(rand_fn() < probs, (len(probs), 1, 1))
image_dest_tran_mats = np.where( # type: ignore
image_dest_tran_mats = np.where(
conditions, image_dest_tran_mats, self._identity_mat
)
bboxes_tran_mats = np.where( # type: ignore
bboxes_tran_mats = np.where(
conditions, bboxes_tran_mats, self._identity_mat

@@ -295,0 +295,0 @@ )

@@ -254,3 +254,3 @@ """

self._rng = tf.random.Generator.from_seed(
seed if seed is not None else np.random.randint(1e6) # type: ignore
seed if seed is not None else np.random.randint(1e6)
)

@@ -257,0 +257,0 @@ self.name = name