FaceAutoVN is a Python-based automation framework combining ADB control and AI-driven image processing (YOLOv10) for seamless Facebook account creation on Android devices. The solution centers on two core modules: main.py
(workflow orchestration + on-device image SDK) and adb.py
(ADBController).
-
Objective: Achieve end-to-end Facebook signup automation—UI detection, form filling, email verification—reducing manual interaction to zero.
-
End-to-end Pipeline:
- Initialize ADBController & scrcpy screen streaming.
- Acquire and preprocess frames (360×800 pixels) for YOLOv10.
- Perform real-time inference (200ms/frame) to detect UI elements.
- Execute taps and text inputs via ADB commands.
- Automate temporary email creation, code polling, and submission.
+-----------------+ +---------------+ +-------------+
| main.py | ----> | ADBController| ----> | Android |
| (Orchestrator & | | (adb.py) | | Device |
| Image API) | +---------------+ +-------------+
| | |
| | v
| | +---------------+
| | ----> | Email Service|
+-----------------+ | tempmail API |
+---------------+
- main.py orchestrates threads for screen capture, YOLO inference, and action handling.
- adb.py provides atomic ADB operations:
tap()
,long_press()
,input_text()
,capture_screenshot()
. - Email Service: REST API integration to
tempmail.id.vn
for disposable mailbox operations.
-
Model Performance: YOLOv10 fine-tuned on ~1,000 annotated Facebook UI frames. Achieves [email protected] = 0.87, Precision = 0.92, Recall = 0.89.
-
Inference Metrics: Average latency 200ms per frame on Intel i7 CPU, throughput >5 FPS.
-
Complexity Analysis:
- Inference: O(n·d²) where n=boxes, d=image size downsample factor.
- ADB I/O: network-bound shell commands with average round-trip 50–100ms.
-
Concurrency: Event-driven multithreading using Python
threading.Event
to coordinate capture and processing pipelines, ensuring <10% CPU overhead on a quad-core system.
git clone https://github.com/CodeWithKhoa/FaceAutoVN.git
cd FaceAutoVN
pip install -r requirements.txt
- Python 3.8+
- ADB & scrcpy (v1.16+) in PATH
- Internet connection for REST API and HuggingFace inference
- Optional: Android emulator
# Disposable email API token
token_email = "<TEMPMAIL_TOKEN>"
# User profile settings
first_name, last_name, gender = "Khoa", "Tranfa", "Female"
birth_day, birth_month, birth_year = "31", "12", "2006"
contact_method = "email" # email | phone
password = "TranKhoa2006"
# AI Inference
model = get_model(
model_id="trandangkhoa/22",
api_key="<HUGGINGFACE_API_KEY>"
)
# Detection threshold
conf_threshold = 0.2 # Filter weak predictions
python main.py
- Auto-launches scrcpy, opens OpenCV display buffer.
- Orchestrates detection → action → email polling → confirmation cycle.
from adb import ADBController
# Initialize controller
device = ADBController(id_device=None, debug=True)
# Screen capture
screenshot = device.capture_screenshot("frame.png")
# UI interactions
device.tap(150, 300)
device.long_press(150, 300, duration_ms=2000)
# Text input
device.input_text("Hello FB", delete=True)
device.delete_left(5)
# Swipe and navigation
device.swipe(100, 500, 100, 100, duration=800)
device.press_back()
device.press_home()
- All methods are thread-safe and managed via internal locks.
- Frame Acquisition:
capture_screenshot()
→ BGR NumPy array. - Preprocessing: Resize to 360×800, convert to RGB PIL.
- Inference:
predictions = model.infer(pil_img)[0].predictions
. - Postprocessing: Iterate predictions to draw bounding boxes and store metadata.
- Event Coordination:
detect_event.set()
signals UI thread for next iteration.
Bounding boxes on Facebook UI.
© 2025 FaceAutoVN by Tran Dang Khoa. All rights reserved.
- License: MIT (see LICENSE).
- Acknowledgements: YOLOv10, OpenCV, scrcpy, tempmail.id.vn