Title: Error with only captcha digit datasets · Issue #59 · pythonlessons/mltu · GitHub
Open Graph Title: Error with only captcha digit datasets · Issue #59 · pythonlessons/mltu
X Title: Error with only captcha digit datasets · Issue #59 · pythonlessons/mltu
Description: Hello, I'm testing your captcha to text tutorial and it works fine with alphanum captcha datasets, but fails with only digits captcha datasets (I'm testing a 4-digit captcha dataset): C:\Projects\Captcha Solver\mltu-main\Tutorials\02_cap...
Open Graph Description: Hello, I'm testing your captcha to text tutorial and it works fine with alphanum captcha datasets, but fails with only digits captcha datasets (I'm testing a 4-digit captcha dataset): C:\Projects\C...
X Description: Hello, I'm testing your captcha to text tutorial and it works fine with alphanum captcha datasets, but fails with only digits captcha datasets (I'm testing a 4-digit captcha dataset): C:\Pr...
Opengraph URL: https://github.com/pythonlessons/mltu/issues/59
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error with only captcha digit datasets","articleBody":"Hello,\r\n\r\nI'm testing your captcha to text tutorial and it works fine with alphanum captcha datasets, but fails with only digits captcha datasets (I'm testing a 4-digit captcha dataset):\r\n\r\n`\r\nC:\\Projects\\Captcha Solver\\mltu-main\\Tutorials\\02_captcha_to_text\u003epython inferenceModel.py\r\n 0%| | 0/28 [00:00\u003c?, ?it/s]\r\nTraceback (most recent call last):\r\n File \"C:\\Projects\\Captcha Solver\\mltu-main\\Tutorials\\02_captcha_to_text\\inferenceModel.py\", line 41, in \u003cmodule\u003e\r\n cer = get_cer(prediction_text, label)\r\n File \"C:\\Users\\mudro\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\mltu\\utils\\text_utils.py\", line 79, in get_cer\r\n for pred_tokens, tgt_tokens in zip(preds, target):\r\nTypeError: 'int' object is not iterable\r\n`\r\n\r\nI fixed the code in inferenceModel.py with:\r\n`\r\nfor image_path, label in tqdm(df):\r\n image = cv2.imread(image_path.replace(\"\\\\\", \"/\"))\r\n\r\n prediction_text = model.predict(image)\r\n\r\n cer = get_cer(prediction_text, str(label).zfill(4))\r\n print(f\"Image: {image_path}, Label: {str(label).zfill(4)}, Prediction: {prediction_text}, CER: {cer}\")\r\n\r\n accum_cer.append(cer)\r\n`\r\n\r\nThis code runs correctly but gives now bad predition results.\r\n","author":{"url":"https://github.com/Mudr0x","@type":"Person","name":"Mudr0x"},"datePublished":"2024-08-05T15:44:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/59/mltu/issues/59"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:443e2835-71f8-b356-66ca-f0a1e39ad003 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B274:3C998:101DAD:162F32:69810C85 |
| html-safe-nonce | 3885f240c4ecfef2670debd6527cca2eb22e379a0eccd1bde671cd59e500f793 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjc0OjNDOTk4OjEwMURBRDoxNjJGMzI6Njk4MTBDODUiLCJ2aXNpdG9yX2lkIjoiMTc5NDc3NjU4MDMyNTcwNjg4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 646237b216726b62c2fcfe58d23f94e850f0eab130495e42969d96f8c2b785a1 |
| hovercard-subject-tag | issue:2448885031 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonlessons/mltu/59/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94bbf2129a9c33d63345f01eaa6267b85cf582d1a5f21ea07e29705a9ae377d6/pythonlessons/mltu/issues/59 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94bbf2129a9c33d63345f01eaa6267b85cf582d1a5f21ea07e29705a9ae377d6/pythonlessons/mltu/issues/59 |
| og:image:alt | Hello, I'm testing your captcha to text tutorial and it works fine with alphanum captcha datasets, but fails with only digits captcha datasets (I'm testing a 4-digit captcha dataset): C:\Projects\C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Mudr0x |
| hostname | github.com |
| expected-hostname | github.com |
| None | 39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonlessons/mltu git https://github.com/pythonlessons/mltu.git |
| octolytics-dimension-user_id | 43852392 |
| octolytics-dimension-user_login | pythonlessons |
| octolytics-dimension-repository_id | 572996960 |
| octolytics-dimension-repository_nwo | pythonlessons/mltu |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572996960 |
| octolytics-dimension-repository_network_root_nwo | pythonlessons/mltu |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d5b34a4e4898b066c629879feb4b184bc471d6a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width