Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NSFW-API/TripleX
/ functions
Functions
84 in github.com/NSFW-API/TripleX
⨍
Functions
84
◇
Types & classes
1
↓ 4 callers
Function
download_model
(file_id, destination)
setup_models.py:4
↓ 4 callers
Function
load_frozen_graph
(model_filename)
utils/analyze_frames.py:18
↓ 3 callers
Function
make_request
Make a request with retry logic for rate limits
downloaders/chan_downloader.py:170
↓ 3 callers
Function
modify_reddit_url
Convert preview.redd.it links to i.redd.it, remove query params, etc.
downloaders/reddit_downloader.py:40
↓ 3 callers
Function
process_detection_results
(boxes, scores, classes, image_width, image_height, labels_path)
utils/analyze_frames.py:85
↓ 3 callers
Function
run_object_detection_inference
(graph, image_np)
utils/analyze_frames.py:62
↓ 2 callers
Function
call_gemini
(inputs, generation_config, model_list)
captioners/gemini.py:74
↓ 2 callers
Function
describe_image
Generate a descriptive caption for an image using JoyCaption2 and save it to a .txt file. Args: image_path (str): Path to the image
captioners/joycaption2.py:37
↓ 2 callers
Function
download_thread_media
Download all media from a specific thread
downloaders/chan_downloader.py:261
↓ 2 callers
Function
extract_sharpest_frame
Extracts the sharpest frame from a video file based on Laplacian variance, excluding frames that contain significant text or are mostly black
utils/extract_sharpest_frame.py:43
↓ 2 callers
Function
fetch_page_content
Fetches the HTML content of the given URL.
downloaders/download_xhamster.py:41
↓ 2 callers
Function
get_composite_caption
(frame_data_list, composite_model_list, custom_prompt="")
captioners/gemini.py:134
↓ 2 callers
Function
get_file_extension
Return a file extension in lowercase, e.g. '.gif' or '.jpg'
downloaders/reddit_downloader.py:130
↓ 2 callers
Function
get_frame_rate
Get the frame rate of the video using ffprobe.
utils/trim_frame_beginning.py:8
↓ 2 callers
Function
ingest_directory
Gather all .json files in scrape_dir and parse them with ingest_file(), skipping filenames listed in completed_list_file. :return: List
downloaders/reddit_downloader.py:174
↓ 2 callers
Function
load_downloaded_threads
Load the set of downloaded thread IDs for each board
downloaders/chan_downloader.py:75
↓ 2 callers
Function
load_labels
(labels_file)
utils/analyze_frames.py:107
↓ 2 callers
Function
preprocess_image
(image_path, input_size)
utils/analyze_frames.py:35
↓ 2 callers
Function
rewrite_composite_caption
(composite_caption)
captioners/gemini.py:46
↓ 1 callers
Function
analyze_frame
(frame_path, pose_graph, watermark_graph, genital_graph, penetration_graph)
utils/analyze_frames.py:113
↓ 1 callers
Function
caption_video
(gcs_uri, prompt_text, fallback_models)
captioners/vertex_ai.py:99
↓ 1 callers
Function
convert_gif_to_mp4
Convert a .gif to .mp4 using ffmpeg
downloaders/reddit_downloader.py:274
↓ 1 callers
Function
detect_text
Detects whether a frame contains significant text. Uses edge detection and contour analysis to filter frames with text overlays.
utils/extract_sharpest_frame.py:8
↓ 1 callers
Function
download_and_process_h264
Downloads and processes an H264 video stream using FFmpeg.
downloaders/download_xhamster.py:126
↓ 1 callers
Function
download_board_media
Download media from threads in a board Args: board: Board name limit: Maximum number of threads to download (None f
downloaders/chan_downloader.py:310
↓ 1 callers
Function
download_file
Download a file from URL to specified path
downloaders/chan_downloader.py:205
↓ 1 callers
Function
download_media
(items, skip_images=False, skip_gifs=False, skip_videos=False, convert_gifs=False)
downloaders/reddit_downloader.py:209
↓ 1 callers
Function
encode_image_from_cv2_image
(cv2_image)
captioners/open_ai.py:34
↓ 1 callers
Function
extract_json_data
Extracts JSON data from the HTML content of the embed page.
downloaders/download_xhamster.py:52
↓ 1 callers
Function
extract_urls
Extract all URLs from text using a regex, including markdown-style [text](url) links.
downloaders/reddit_downloader.py:51
↓ 1 callers
Function
get_audio_codec
Get the audio codec of the input video.
utils/trim_frame_beginning.py:56
↓ 1 callers
Function
get_best_quality_stream
Selects the best quality stream URL from the master playlist.
downloaders/download_xhamster.py:95
↓ 1 callers
Function
get_board_catalog
Get complete catalog of threads for a board
downloaders/chan_downloader.py:232
↓ 1 callers
Function
get_file_extension
Return file extension in lowercase
downloaders/chan_downloader.py:147
↓ 1 callers
Function
get_file_type
Return a string: 'image', 'gif', 'video', or 'unknown' based on recognized extensions.
downloaders/reddit_downloader.py:136
↓ 1 callers
Function
get_file_type
Determine file type based on extension Returns: 'image' for .jpg, .jpeg, .png, .webp 'gif' for .gif 'video
downloaders/chan_downloader.py:151
↓ 1 callers
Function
get_frame_caption
(image_bytes, timestamp, model_list, custom_prompt="")
captioners/gemini.py:97
↓ 1 callers
Function
get_last_frame
(video_path)
captioners/open_ai.py:16
↓ 1 callers
Function
get_nearest_frame_count
(frame_count, allowed_counts)
utils/training/hunyuan/output_clips_to_hunyuan_dataset.py:7
↓ 1 callers
Function
get_playlists
Retrieves H264 and AV1 playlists for a given video ID.
downloaders/download_xhamster.py:69
↓ 1 callers
Function
get_target_resolution
(width, height, allowed_resolutions)
utils/training/hunyuan/output_clips_to_hunyuan_dataset.py:13
↓ 1 callers
Function
get_thread_data
Get JSON data for a specific thread
downloaders/chan_downloader.py:222
↓ 1 callers
Function
get_thread_directory
Get the directory path for a specific thread's media
downloaders/chan_downloader.py:124
↓ 1 callers
Function
get_thread_title
Extract and clean thread title from thread data
downloaders/chan_downloader.py:102
↓ 1 callers
Function
get_video_codec
Get the video codec of the input video.
utils/trim_frame_beginning.py:36
↓ 1 callers
Function
get_video_id
Extracts the video ID from the given xHamster video URL.
downloaders/download_xhamster.py:30
↓ 1 callers
Function
ingest_file
(json_path)
downloaders/reddit_downloader.py:152
↓ 1 callers
Function
init_reddit
Initialize and return the Reddit API connection using PRAW. Switch to environment variables (os.getenv) if you want them in .env instead
downloaders/reddit_downloader.py:26
↓ 1 callers
Function
is_mostly_black_or_white
Detects if a frame is mostly black or white. Args: frame (numpy.ndarray): The video frame. threshold (float): Proportion of p
utils/extract_sharpest_frame.py:24
↓ 1 callers
Function
is_thread_downloaded
Check if a thread has been downloaded
downloaders/chan_downloader.py:97
↓ 1 callers
Function
load_first_condition_timestamp
Load the 'first_condition_timestamp' from a JSON file if present. Returns a float or None if not available.
utils/trim_frame_beginning.py:126
↓ 1 callers
Function
main
()
setup_models.py:10
↓ 1 callers
Function
main
()
utils/split_by_scene.py:35
↓ 1 callers
Function
main
()
utils/extract_sharpest_frame.py:123
↓ 1 callers
Function
main
()
utils/analyze_frames.py:177
↓ 1 callers
Function
main
Main entry point for the script. Usage: python script.py [NUM_FRAMES or 'auto']
utils/trim_frame_beginning.py:153
↓ 1 callers
Function
main
CLI that supports: 1) Scraping subreddits into reddit_data/ 2) Ingesting all .json to gather media URLs 3) Downloading images/gifs/vi
downloaders/reddit_downloader.py:296
↓ 1 callers
Function
main
Main function to download xHamster videos based on URL input.
downloaders/download_xhamster.py:137
↓ 1 callers
Function
main
()
downloaders/chan_downloader.py:338
↓ 1 callers
Function
main
()
captioners/gemini.py:345
↓ 1 callers
Function
main
()
captioners/vertex_ai.py:262
↓ 1 callers
Function
mark_thread_downloaded
Mark a thread as downloaded
downloaders/chan_downloader.py:84
↓ 1 callers
Method
print_summary
Print download statistics summary
downloaders/chan_downloader.py:33
↓ 1 callers
Function
process_directory
Process all images in a directory and generate captions for each. Args: directory_path (str): Path to the directory containing image
captioners/joycaption2.py:117
↓ 1 callers
Function
process_image
(file_path, individual_model_list, composite_model_list, custom_prompt="", output_dir=None)
captioners/gemini.py:272
↓ 1 callers
Function
process_pose_predictions
(predictions)
utils/analyze_frames.py:77
↓ 1 callers
Function
process_post
Extract media information from a post
downloaders/chan_downloader.py:242
↓ 1 callers
Function
process_video
(video_path, output_path, allowed_frame_counts, allowed_resolutions)
utils/training/hunyuan/output_clips_to_hunyuan_dataset.py:28
↓ 1 callers
Function
process_video
(file_path, fps, individual_model_list, composite_model_list, custom_prompt="", max_frames=None,
captioners/gemini.py:162
↓ 1 callers
Function
process_video
Upload the video file and obtain caption outputs, etc.
captioners/vertex_ai.py:159
↓ 1 callers
Function
process_videos
(input_dir, output_dir)
utils/training/hunyuan/output_clips_to_hunyuan_dataset.py:56
↓ 1 callers
Function
rename_pairs
(directory)
utils/rename_files.py:4
↓ 1 callers
Function
run_classification_inference
(graph, image_np)
utils/analyze_frames.py:53
↓ 1 callers
Function
scrape_subreddits_list
(sub_list, output_dir="reddit_data", limit=None)
downloaders/reddit_downloader.py:65
↓ 1 callers
Function
setup_directories
Create necessary directories if they don't exist
downloaders/chan_downloader.py:63
↓ 1 callers
Function
setup_logging
Setup logging with specified level
downloaders/chan_downloader.py:12
↓ 1 callers
Function
split_video_into_scene_clips
(video_path, output_dir, threshold=15.0, min_scene_len=15)
utils/split_by_scene.py:8
↓ 1 callers
Function
trim_video
Trim the first num_frames from the video at input_path and overwrite the file.
utils/trim_frame_beginning.py:84
↓ 1 callers
Function
upload_to_gcs
Uploads a local file to the given GCS bucket and returns its GCS URI.
captioners/vertex_ai.py:84
↓ 1 callers
Function
validate_local_video
Check if the file is non-empty and optionally verify its metadata. Returns True if valid; otherwise False.
captioners/vertex_ai.py:56
Method
__init__
(self)
downloaders/chan_downloader.py:26
Function
print_tensor_names
(graph)
utils/analyze_frames.py:29
Function
process_file
(file_path, args, video_exts, image_exts)
captioners/gemini.py:332
Function
process_video
Helper function for multiprocessing. Expects tuple: (input_path, frames_to_trim).
utils/trim_frame_beginning.py:144