Skip to content

Commit

Permalink
Update auto_labeling.py
Browse files Browse the repository at this point in the history
  • Loading branch information
QIN2DIM committed Oct 25, 2023
1 parent 5976a2f commit 7c79793
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions automation/auto_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@
from pathlib import Path
from typing import Tuple, List

import hcaptcha_challenger as solver
from PIL import Image
from hcaptcha_challenger import (
DataLake,
install,
ModelHub,
ZeroShotImageClassifier,
register_pipline,
)
from hcaptcha_challenger import DataLake, ModelHub, ZeroShotImageClassifier, register_pipline
from tqdm import tqdm

from flow_card import flow_card
Expand All @@ -30,7 +25,7 @@
level=logging.INFO, stream=sys.stdout, format="%(asctime)s - %(levelname)s - %(message)s"
)

install(upgrade=True)
solver.install(upgrade=True)


@dataclass
Expand Down Expand Up @@ -131,12 +126,14 @@ def execute(self, model):


def run():
images_dir = Path(__file__).parent.parent.joinpath("database2309")

modelhub = ModelHub.from_github_repo()
modelhub.parse_objects()

model = register_pipline(modelhub)

images_dir = Path(__file__).parent.parent.joinpath("database2309")
# Make sure you have torch and transformers installed and
# the NVIDIA graphics card is available
model = register_pipline(modelhub, fmt="transformers")

for card in flow_card:
# Filter out the task cards we care about
Expand Down

0 comments on commit 7c79793

Please sign in to comment.