Open TomasTillmann opened 1 year ago
Just tried the example_input.png image, and that works as well, with 100% accuracy.
Likely the JavaScript online model and the local Python one have some preprocessing step differences such as image resize etc. , Have a look in https://github.com/Elucidation/ChessboardFenTensorflowJs
I don't remember if the model used between the two of those is the same or different, that's possibly another reason.
If you don't find anything let me know
On Sat, Jul 22, 2023, 06:09 Tomas Tillmann @.***> wrote:
Just tried the example_input.png image, and that works as well, with 100% accuracy.
— Reply to this email directly, view it on GitHub https://github.com/Elucidation/tensorflow_chessbot/issues/41#issuecomment-1646580963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKF3PBIZMOIW46DFAING3XRPGG7ANCNFSM6AAAAAA2T2LIWQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I think it's perhaps about the dimensions of the input picture. Does it have to be on some specified dimensions? It seems to me like the web version scales it, and this one doesn't.
There's no specific preferred size, it eventually gets scaled down to something like 32x32 pixels per chessboard tile, so possibly what's going on is the lined pattern texture from the image you shared is confusing the Python model whereas the JavaScript web one has scaled it down to where it's blurry enough to not interfere. You can test this by manually trying different resizes and see what works for you
On Sat, Jul 22, 2023, 11:54 Tomas Tillmann @.***> wrote:
I think it's perhaps about the dimensions of the input picture. Does it have to be on some specified dimensions? It seems to me like the web version scales it, and this one doesn't.
— Reply to this email directly, view it on GitHub https://github.com/Elucidation/tensorflow_chessbot/issues/41#issuecomment-1646650243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKF3OT2UD3JL25GVUYLSLXRQOX5ANCNFSM6AAAAAA2T2LIWQ . You are receiving this because you commented.Message ID: @.***>
Yes, that seems to be the reason. Thanks.
Do you think it could be possible to do something about it though? I experimted a bit, and if I blur the image, making the quality of the image lower, it works correctly. But that feels like a hack ..., and it also makes the work for the model harder, since the pieces are not as sharp as they could be. Potentially leading to wrong piece prediction.
I think it would be very nice for the chessboard recognizer to understand even if the black tiles are hatched and not fully black colored, where the grid lines are. Do you think it could be done? Perhaps by feeding it boards with hatched black tiles?
I feel like majority of chess pdf books are having black tiles hatched, so it could be a really useful improvement. To name some: The woodpecker method, Encyclopedia of chess tactics, ...
Good to hear, and yes there are 2 parts,
On Tue, Jul 25, 2023 at 9:30 AM Tomas Tillmann @.***> wrote:
Yes, that seems to be the reason. Thanks.
Do you think it could be possible to do something about it though? I experimted a bit, and if I blur the image, making the quality of the image lower, it works correctly. But that feels like a hack ..., and it also makes the work for the model harder, since the pieces are not as sharp as they could be. Potentially leading to wrong piece prediction.
I think it would be very nice for the chessboard recognizer to understand even if the black tiles are hatched and not fully black colored, where the grid lines are. Do you think it could be done? Perhaps by feeding it boards with hatched black tiles?
I feel like majority of chess pdf books are having black tiles hatched, so it could be a really useful improvement. To name some: The woodpecker method, Encyclopedia of chess tactics, ...
— Reply to this email directly, view it on GitHub https://github.com/Elucidation/tensorflow_chessbot/issues/41#issuecomment-1650163565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKF3ILYYFGFRWNGNJHIMDXR7YBFANCNFSM6AAAAAA2T2LIWQ . You are receiving this because you commented.Message ID: @.***>
Hi,
not sure what I'm doing wrong, for this image: , the website demo returnes correct fen string, but local installation doesnt' work.
Interestingly, the example --url image works locally just fine.
pip list
output:python --version
output:Executing by:
python .\tensorflow_chessbot.py --filepath "C:\Users\tomas\Pictures\Screenshots\whole-board.png"
Output:Thanks.