yokonsan / midjourney-api

midjourney in discord api.
809 stars 180 forks source link

当调用量大了之后,100张,会需要人工验证。 #2

Open ddkwing opened 1 year ago

ddkwing commented 1 year ago

请问该如何解决这个情况

yokonsan commented 1 year ago

我现在还没遇上这种情况,能提供截图吗

ddkwing commented 1 year ago

239658260-42c1bc02-8174-4ca2-9433-e551a52d7e88

yokonsan commented 1 year ago

感谢 这似乎只能上报错误提示,由业务端处理了

getidone commented 1 year ago

请问: 一直提示这个错误:iscord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead 这是什么情况?

getidone commented 1 year ago

请问: 一直提示这个错误:iscord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead 这是什么情况?

解决了

BlueSchnabeltier commented 1 year ago

我做了一个验证码解析器,这是代码: https://file.io/IbISKKXxVcxu

你需要运行"setup.bat"或"setup.sh",然后可以查看"example.py",解析器的演示在那里。

skrleo commented 1 year ago

我做了一个验证码解析器,这是代码: https://file.io/IbISKKXxVcxu

你需要运行"setup.bat"或"setup.sh",然后可以查看"example.py",解析器的演示在那里。

看不到是不是链接异常了

yokonsan commented 1 year ago

出2000多张了,还没遇上验证码 😂

BlueSchnabeltier commented 1 year ago

出2000多张了,还没遇上验证码 😂

Captcha solver:

from spacy import load
from imageai.Classification import ImageClassification

class CaptchaSolver:
    def __init__(self, imageai_model: str):
        self.__nlpm = load("en_core_web_lg")
        self.__imageai_model = imageai_model

    def __describe_image(self, image_path: str):
        prediction = ImageClassification()

        prediction.setModelTypeAsResNet50()
        prediction.setModelPath(self.__imageai_model)
        prediction.loadModel()

        results = prediction.classifyImage(image_path)

        return {label: score for label, score in zip(results[0], results[1])}

    def __compare_word_to_list(self, input_word: str, word_list: list):
        similar_words = {}

        for current_word in word_list:
            similarity_score = self.__nlpm(input_word).similarity(self.__nlpm(current_word))
            similar_words[current_word] = similarity_score

        return max(similar_words.values())

    def solve(self, captcha_answers: list, image_path: str):
        best_fit = None
        best_similarity = 0
        image_classification = self.__describe_image(image_path)

        for answer in captcha_answers:
            similarity = self.__compare_word_to_list(answer, list(image_classification.keys()))

            if similarity > best_similarity:
                best_fit = answer
                best_similarity = similarity

        return best_fit

requirements:

pip install spacy imageai
python -m spacy download en_core_web_lg
curl -o ./resnet50.pth https://github.com/OlafenwaMoses/ImageAI/releases/download/3.0.0-pretrained/resnet50-19c8e357.pth
Sandralan-calmdown commented 1 year ago

image 关掉这个应该就可以了。

Kinbon commented 4 weeks ago

请问: 一直提示这个错误:iscord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead 这是什么情况?

解决了

我也遇到了相同问题,请问是如何解决的