Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ Add docs for newly-added OP image_face_count_filter #455

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configs/config_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ process:
min_ratio: 0.333 # the min aspect ratio of filter range
max_ratio: 3.0 # the max aspect ratio of filter range
any_or_all: any # keep this sample when any/all images meet the filter condition
- image_face_count_filter: # filter samples according to the face count in images
cv_classifier: '' # OpenCV classifier path for face detection. By default, we will use 'haarcascade_frontalface_alt.xml'.
min_face_count: 1 # the minimum number of faces required for samples.
max_face_count: 1 # the maximum number of faces required for samples.
- image_face_ratio_filter: # filter samples according to the face area ratios in images (r=face_area/image_area). If multiple faces are available, we use the largest one.
cv_classifier: '' # OpenCV classifier path for face detection. By default, we will use 'haarcascade_frontalface_alt.xml'.
min_ratio: 0.0 # the min face area ratio of filter range
Expand Down
24 changes: 13 additions & 11 deletions data_juicer/ops/filter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
audio_nmf_snr_filter, audio_size_filter,
average_line_length_filter, character_repetition_filter,
flagged_words_filter, image_aesthetics_filter,
image_aspect_ratio_filter, image_face_ratio_filter,
image_nsfw_filter, image_pair_similarity_filter,
image_shape_filter, image_size_filter,
image_text_matching_filter, image_text_similarity_filter,
image_watermark_filter, language_id_score_filter,
maximum_line_length_filter, perplexity_filter,
phrase_grounding_recall_filter, special_characters_filter,
specified_field_filter, specified_numeric_field_filter,
stopwords_filter, suffix_filter, text_action_filter,
text_entity_dependency_filter, text_length_filter,
token_num_filter, video_aesthetics_filter,
image_aspect_ratio_filter, image_face_count_filter,
image_face_ratio_filter, image_nsfw_filter,
image_pair_similarity_filter, image_shape_filter,
image_size_filter, image_text_matching_filter,
image_text_similarity_filter, image_watermark_filter,
language_id_score_filter, maximum_line_length_filter,
perplexity_filter, phrase_grounding_recall_filter,
special_characters_filter, specified_field_filter,
specified_numeric_field_filter, stopwords_filter, suffix_filter,
text_action_filter, text_entity_dependency_filter,
text_length_filter, token_num_filter, video_aesthetics_filter,
video_aspect_ratio_filter, video_duration_filter,
video_frames_text_similarity_filter, video_motion_score_filter,
video_nsfw_filter, video_ocr_area_ratio_filter,
Expand All @@ -29,6 +29,7 @@
from .flagged_words_filter import FlaggedWordFilter
from .image_aesthetics_filter import ImageAestheticsFilter
from .image_aspect_ratio_filter import ImageAspectRatioFilter
from .image_face_count_filter import ImageFaceCountFilter
from .image_face_ratio_filter import ImageFaceRatioFilter
from .image_nsfw_filter import ImageNSFWFilter
from .image_pair_similarity_filter import ImagePairSimilarityFilter
Expand Down Expand Up @@ -102,6 +103,7 @@
'ImageSizeFilter',
'VideoWatermarkFilter',
'WordsNumFilter',
'ImageFaceCountFilter',
'ImageFaceRatioFilter',
'FlaggedWordFilter',
'WordRepetitionFilter',
Expand Down
Loading
Loading