builtree / handwrite

Handwrite generates a custom font based on your handwriting sample.
https://pypi.org/project/handwrite/
MIT License
366 stars 46 forks source link

Zero clue whatsoever :) #85

Closed twenty41 closed 9 months ago

twenty41 commented 9 months ago

Don't know what a single tiny miniscule portion of this means whatsoever. image

C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts>handwrite C:\Users\admin\Desktop\paperscan.jpg C:\Users\admin\Desktop\
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\handwrite.exe\__main__.py", line 7, in <module>
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 56, in main
    converters(
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 34, in converters
    run(sheet, output_directory, directory, config, metadata)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 12, in run
    SHEETtoPNG().convert(sheet, characters_dir, config)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\sheettopng.py", line 44, in convert
    characters = self.detect_characters(
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\sheettopng.py", line 116, in detect_characters
    x, y, w, h = cv2.boundingRect(contours[i])
                                  ~~~~~~~~^^^
IndexError: list index out of range

C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts>

Followed instructions exactly Two friends who are smarter than me in this field also don't know how to fix it

yashlamba commented 9 months ago

Hey @twenty41 , looks to me that the boxes weren't detected correctly. Maybe improve the image quality or share here if you can and I'll take a look.

twenty41 commented 9 months ago

pape Not sure, this is at the same res as the original sample. The original scan was much higher res. Could it be the slight problem at the bottom? I'll get a better sample tomorrow

twenty41 commented 9 months ago

Got a better scan with no cut-off and no fixing needed. Still getting this

C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts>handwrite C:\Users\admin\Desktop\papiera.jpg C:\Users\admin\Desktop
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\handwrite.exe\__main__.py", line 7, in <module>
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 56, in main
    converters(
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 34, in converters
    run(sheet, output_directory, directory, config, metadata)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\cli.py", line 14, in run
    SVGtoTTF().convert(characters_dir, output_directory, config, metadata)
  File "C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\handwrite\svgtottf.py", line 28, in convert
    subprocess.run(
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts>

papiera

yashlamba commented 9 months ago

Hey, so the previous issue was because of the boxes only. This is one is because you don't have fontforge installed. Refer: https://www.builtree.org/handwrite/installation/ (I tried it on my system and it works)

twenty41 commented 9 months ago

I have it! image Unless I'm supposed to install it some other way. It just says install. Does it need to be on my C drive?

yashlamba commented 9 months ago

fontforge cli should be accessible. I'vent worked on this project actively recently so I don't remember if there's anything special we need to do for that. (I think you just need to add the /bin to path)

https://fontforge.org/docs/techref/cliargs.html

twenty41 commented 9 months ago

Added Fontforge bin to path and it worked. Thanks for your willingness to answer and walk me through it