- http://github.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import face_recognition | |
class FaceImageProcessor: | |
@staticmethod | |
def process_image(filename): | |
try: | |
image = face_recognition.load_image_file(filename) | |
face_locations = face_recognition.face_locations(image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dlib | |
from main.common.ConfigLoader import ConfigLoader | |
from main.face_filter.FaceImageProcessor import FaceImageProcessor | |
from main.face_filter.ImageBatchManager import ImageBatchManager | |
from pathlib import Path | |
class Application: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from main.common.ImageRemover import ImageRemover | |
class DeleteSmallImages: | |
def __init__(self, min_size_kb, max_size_mb): | |
self.min_size_bytes = min_size_kb * 1024 | |
self.max_size_bytes = max_size_mb * 1024 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from main.common.ConfigLoader import ConfigLoader | |
from main.image_filter.DeleteSmall import DeleteSmallImages | |
class Application: | |
def __init__(self, config_path): | |
self.config_loader = ConfigLoader(config_path) | |
self.image_filter = DeleteSmallImages(self.config_loader.load_config()['min_size_kb'], | |
self.config_loader.load_config()['max_size_mb']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class URLManager: | |
def __init__(self, urls_file): | |
self.urls_file = urls_file | |
def get_urls(self): | |
with open(self.urls_file, 'r') as file: | |
return [line.strip() for line in file] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
from pathlib import Path | |
import requests | |
class ImageDownloader(ABC): | |
@abstractmethod | |
def download(self, url, download_loc_dir): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent.futures import ThreadPoolExecutor | |
import time | |
from pathlib import Path | |
from main.image_downloader.ImageDownloader import HTTPImageDownloader | |
from main.image_downloader.URLManager import URLManager | |
from main.common.ConfigLoader import ConfigLoader | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253915.jpg | |
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253914.jpg | |
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253918.jpg |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253915.jpg | |
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253914.jpg | |
https://exampledoamin.jp/iv/detail/?s=32970531&i=202303/20/10/f0141310_08253918.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"urls_file": "resources/links/prod/jpg_links.csv", | |
"download_dir": "resources/downloads", | |
"num_threads": 20, | |
"min_size_kb": 100, | |
"max_size_mb": 5 | |
} |