mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
Remove useless code in doctests (#7733)
* refactor: Fix matrix display deprecation * refactor: Remove useless `print` and `pass` statements * revert: Replace broken doctests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * revert: Fix failing doctests * chore: Satisfy pre-commit Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
501a1cf0c7
commit
61eedc16c3
@ -22,7 +22,6 @@ def main() -> None:
|
||||
Get images list and annotations list from input dir.
|
||||
Update new images and annotations.
|
||||
Save images and annotations in output dir.
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
img_paths, annos = get_dataset(LABEL_DIR, IMAGE_DIR)
|
||||
print("Processing...")
|
||||
@ -48,7 +47,6 @@ def get_dataset(label_dir: str, img_dir: str) -> tuple[list, list]:
|
||||
- label_dir <type: str>: Path to label include annotation of images
|
||||
- img_dir <type: str>: Path to folder contain images
|
||||
Return <type: list>: List of images path and labels
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
img_paths = []
|
||||
labels = []
|
||||
@ -88,7 +86,6 @@ def update_image_and_anno(
|
||||
- new_imgs_list <type: narray>: image after resize
|
||||
- new_annos_lists <type: list>: list of new annotation after scale
|
||||
- path_list <type: list>: list the name of image file
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
new_annos_lists = []
|
||||
path_list = []
|
||||
|
@ -23,7 +23,6 @@ def main() -> None:
|
||||
Get images list and annotations list from input dir.
|
||||
Update new images and annotations.
|
||||
Save images and annotations in output dir.
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
img_paths, annos = get_dataset(LABEL_DIR, IMG_DIR)
|
||||
for index in range(NUMBER_IMAGES):
|
||||
@ -60,7 +59,6 @@ def get_dataset(label_dir: str, img_dir: str) -> tuple[list, list]:
|
||||
- label_dir <type: str>: Path to label include annotation of images
|
||||
- img_dir <type: str>: Path to folder contain images
|
||||
Return <type: list>: List of images path and labels
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
img_paths = []
|
||||
labels = []
|
||||
@ -105,7 +103,6 @@ def update_image_and_anno(
|
||||
- output_img <type: narray>: image after resize
|
||||
- new_anno <type: list>: list of new annotation after scale
|
||||
- path[0] <type: string>: get the name of image file
|
||||
>>> pass # A doctest is not possible for this function.
|
||||
"""
|
||||
output_img = np.zeros([output_size[0], output_size[1], 3], dtype=np.uint8)
|
||||
scale_x = scale_range[0] + random.random() * (scale_range[1] - scale_range[0])
|
||||
|
Reference in New Issue
Block a user