Skip to content

Commit

Permalink
+ Add docs for newly-added OP image_face_count_filter (#455)
Browse files Browse the repository at this point in the history
* + Add docs for newly-added OP image_face_count_filter

* * fix wrong import
  • Loading branch information
HYLcool authored Oct 23, 2024
1 parent 5e1f720 commit 71f0fec
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 101 deletions.
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

0 comments on commit 71f0fec

Please sign in to comment.