Git Product home page Git Product logo

Comments (2)

QIN2DIM avatar QIN2DIM commented on July 4, 2024 1

🥂 Thank you for your support.

Active avoidance mechanism

For this issue, let me first make it clear that it is not a bug. I have designed an active avoidance mechanism in the program.

You can find it in the source code:

# 博大精深!
self.label_alias = {
"自行车": "bicycle",
"火车": "train",
"卡车": "truck",
"公交车": "bus",
"巴土": "bus",
"巴士": "bus",
"飞机": "aeroplane",
"ー条船": "boat",
"船": "boat",
"汽车": "car",
"摩托车": "motorbike",
"垂直河流": "vertical river",
"天空中向左飞行的飞机": "airplane in the sky flying left",
}

I treat challenge labels that do not appear in the label_alias dictionary as "new label" that I encountered by accident. In this case the program will actively avoid the challenge and ask the upper level driver to refresh the challenge elements. Such decisions can avoid unnecessary hassles.

Therefore, for demonstration purposes, I considered seaplane as a "new label" and actively kicked it out of the label_alias dictionary.

Passive avoidance mechanism

On the other hand, I offer a retreat method for avoiding challenges that some known models cannot handle. Again, for demonstration purposes, there is a default challenge label seaplane in this list.

You can find it in the source code:

def tactical_retreat(self) -> bool:
"""模型存在泛化死角,遇到指定标签时主动进入下一轮挑战,节约时间"""
if self.label in ["水上飞机"] or not self.label_alias.get(self.label):
self.log(message="模型泛化较差,逃逸", label=self.label)
return True
return False

Refresh the hCAPTCHA elements

As you can see from the above, it is essential to actively refresh the challenge elements. However, it is clear that the current project lacks the mechanisms described above.

This project was spun off from a previous project I was working on and there are still some features that have not been migrated.I will add this mechanism where necessary in a future version, but if you want to use hcapcha-challenger in your own projects I think you know how to do it.

from hcaptcha-challenger.

GoldDust69 avatar GoldDust69 commented on July 4, 2024

Thank you so much for your detailed response!

I've re-read the code after your explanation and now I understand how you handle this. For my project I've now added a simple refresh and retry until a valid label is returned.

I look forward to seeing what changes are made in the future :)

from hcaptcha-challenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.