Skip to content

Commit

Permalink
Update roboflow_resnet.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
QIN2DIM committed Oct 30, 2023
1 parent 12ec1dc commit 96b295e
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions automation/roboflow_resnet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"execution_count": null,
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"!nvidia-smi"
],
"metadata": {
Expand All @@ -39,27 +37,44 @@
}
},
{
"cell_type": "code",
"cell_type": "markdown",
"source": [
"!pip install loguru onnx fire hcaptcha-challenger\n",
"!git clone https://github.com/captcha-challenger/hcaptcha-model-factory.git\n",
"!mv -f hcaptcha-model-factory/src .\n",
"!rm -rf hcaptcha-model-factory/"
"Set `task_name` and `onnx_archive_name`"
],
"metadata": {
"id": "1pTzykxKeaKk"
},
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": []
"outputs": [],
"source": [
"GITHUB_TOKEN = \"\"\n",
"task_name = \"robot\"\n",
"onnx_archive_name = \"robot2312\"\n",
"\n",
"# If you are training a nested model,\n",
"# you need to specify the `solver.handle(prompt)` it is bound to.\n",
"# Otherwise, please set it to empty\n",
"NESTED_PROMPT = \"\""
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"Set `task_name` and `onnx_archive_name`"
"!pip install loguru onnx fire hcaptcha-challenger\n",
"!git clone https://github.com/captcha-challenger/hcaptcha-model-factory.git\n",
"!mv -f hcaptcha-model-factory/src .\n",
"!rm -rf hcaptcha-model-factory/"
],
"metadata": {
"collapsed": false,
"id": "4_GBcuSeEMEY"
"collapsed": false
}
},
{
Expand All @@ -71,24 +86,12 @@
"\n",
"import hcaptcha_challenger as solver\n",
"\n",
"os.environ[\"GITHUB_TOKEN\"] = \"\"\n",
"task_name = \"robot\"\n",
"onnx_archive_name = \"robot2312\"\n",
"\n",
"# If you are training a nested model,\n",
"# you need to specify the `handle(prompt)` it is bound to.\n",
"# Otherwise, please set it to empty\n",
"NESTED_PROMPT = \"\"\n",
"os.environ[\"GITHUB_TOKEN\"] = GITHUB_TOKEN\n",
"\n",
"solver.diagnose_task(task_name)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "NLfyF05xEMEZ",
"outputId": "161cf11e-a722-4ca4-9ceb-7efdd35b0216"
"collapsed": false
}
},
{
Expand Down Expand Up @@ -279,7 +282,7 @@
" }\n",
" )\n",
"\n",
" def to_yaml(self, path: Path | None = None):\n",
" def to_yaml(self, path: Path = None):\n",
" path = path or Path(\"objects-tmp.yaml\")\n",
" with open(path, \"w\", encoding=\"utf8\") as file:\n",
" yaml.safe_dump(self.__dict__, file, sort_keys=False, allow_unicode=True)\n",
Expand Down Expand Up @@ -320,7 +323,7 @@
" return self._asset\n",
"\n",
" @staticmethod\n",
" def parse_resnet_label(asset_name: str) -> str | None:\n",
" def parse_resnet_label(asset_name: str) -> str:\n",
" \"\"\"\n",
" asset_name: dog2312.onnx chess_piece2309.onnx\n",
" \"\"\"\n",
Expand Down

0 comments on commit 96b295e

Please sign in to comment.