🥂 Gracefully face hCaptcha challenge with Yolov5(ONNX) embedded solution.
Project description
Introduction
Does not rely on any Tampermonkey script.
Does not use any third-party anti-captcha services.
Just implement some interfaces to make AI vs AI possible.
Requirements
- Python 3.7+
- google-chrome
Usage
-
Clone the project code in the way you like.
-
Execute the following command in the project root directory.
# hcaptcha-challenger pip install -r ./requirements.txt
-
Download Project Dependencies.
The implementation includes downloading the
YOLOv5object detection model and detectinggoogle-chromein the current environment.If
google-chromeis missing please follow the prompts to download the latest version of the client, if google-chrome is present you need to make sure it is up to date.Now you need to execute the
cdcommand to access thesrc/directory of project and execute the following command to download the project dependencies.# hcaptcha-challenger/src python main.py install
-
Start the test program.
Check if
chromedriveris compatible withgoogle-chrome.# hcaptcha-challenger/src python main.py test
-
Start the demo program.
If the previous test passed perfectly, now is the perfect time to run the demo!
# hcaptcha-challenger/src python main.py demo
Advanced
-
You can download yolov5 onnx models of different sizes by specifying the
modelparameter in theinstallcommand.-
Download
yolov5s6by default when no parameters are specified. -
The models that can be chosen are
yolov5n6锛宍yolov5m6锛宍yolov5s6.
# hcaptcha-challenger/src python main.py install --model=yolov5n6
-
-
You can run different yolo models by specifying the
modelparameter to compare the performance difference between them.-
Similarly, when the
modelparameter is not specified, theyolov5s6model is used by default. -
Note that you should use
installto download the missing models before running the demo.
# hcaptcha-challenger/src python main.py demo --model=yolov5n6
-
-
Specify the challenge source.
Mapping the target site's
hcaptcha iframeto the demo site by specifying thesite-key. The selectable sources can be viewed in the variable _SITE_KEYS.# hcaptcha-challenger/src python main.py demo --target=discord
-
Specify the challenge language.
[dev] Start the challenge in the specified language and the page elements will be replaced. Currently only
zhandenare supported.# hcaptcha-challenger/src python main.py demo --lang=en
Solutions
You may be surprised by the lack of a pass rate in the following table, but if you have run the hcaptcha-challenger demo, you will see that it is almost impossible to fail a challenge, i.e. the pass rates for the various solutions provided by hcaptcha-challenger are almost close to THE ONE.
YOLOv5(onnx)
The following table shows the average solving time of the hCAPTCHA challenge for 30 rounds (one round for every 9 challenge images) of mixed categories processed by onnx models of different sizes.
- Use of the
YOLOv5n6(onnx)embedded scheme to obtain solution speeds close to the limit. - Use of the
YOLOv5s6(onnx)embedded solution, which allows for an optimal balance between stability, power consumption, and solution efficiency.
| model(onnx) | avg_time(s) | size(MB) |
|---|---|---|
| yolov5n6 | 0.71 | 12.4 |
| yolov5s6 | 1.422 | 48.2 |
| yolov5m6 | 3.05 | 136 |
SK-IMAGE
The following table shows the speed statistics of solving for specific labels using image segmentation in the same experimental setting.
- The solving time is negligible using the
rainbowmethod, which is as fast as taking a dictionary value. - The advantage of the
basemethod is that it does not rely on any external model and can perform tasks in a variety of low-configuration containers through image processing alone.
| method(SK-IMAGE) | avg_time(ms) | size(MB) |
|---|---|---|
| vertical river (base) | 2883 | / |
| vertical river (rainbow) | / | 0.29 |
| airplane in the sky flying left (base) | 30 | / |
| airplane in the sky flying left (rainbow) | / | 0.29 |
Tour
Install Google Chrome on Ubuntu 18.04+
-
Downloading Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -
Installing Google Chrome
sudo apt install ./google-chrome-stable_current_amd64.deb
Install Google Chrome on CentOS 7/8
-
Start by opening your terminal and downloading the latest Google Chrome
.rpmpackage with the following wget command :wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm -
Once the file is downloaded, install Google Chrome on your CentOS 7 system by typing:
sudo yum localinstall google-chrome-stable_current_x86_64.rpm
Install Google Chrome on Windows / MacOS
Just go to Google Chrome official website to download and install.
Reference
- hCaptcha challenge template site @maximedrn
- ultralytics/yolov5: YOLOv5 馃殌
- ultrafunkamsterdam/undetected-chromedriver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file hcaptcha-challenger-0.0.1.1.tar.gz.
File metadata
- Download URL: hcaptcha-challenger-0.0.1.1.tar.gz
- Upload date:
- Size: 55.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b52267e0ad65b8b6664893f7837991c59ccc6b7c4274cb4d1ad0b7f52406bb56
|
|
| MD5 |
2dd38b4df82b0edce4f51b9b32a9e715
|
|
| BLAKE2b-256 |
6f7256f1885893fab781e1d48e6b4abfeeabad151afc771f592559b2c77c2019
|