pix2tex: Using a ViT to convert images of equations into LaTeX code.

Overview

pix2tex - LaTeX OCR

The goal of this project is to create a learning based system that takes an image of a math formula and returns corresponding LaTeX code.

header

Requirements

Model

  • PyTorch (tested on v1.7.1)
  • Python 3.7+ & dependencies (requirements.txt)
    pip install -r requirements.txt
    

Dataset

In order to render the math in many different fonts we use XeLaTeX, generate a PDF and finally convert it to a PNG. For the last step we need to use some third party tools:

Using the model

  1. Download/Clone this repository
  2. For now you need to install the Python dependencies specified in requirements.txt (look above)
  3. Download the weights.pth (and optionally image_resizer.pth) file from my Google Drive and place it in the checkpoints directory

Thanks to @katie-lim, you can use a nice user interface as a quick way to get the model prediction. Just call the GUI with python gui.py. From here you can take a screenshot and the predicted latex code is rendered using MathJax and copied to your clipboard.

demo

If the model is unsure about the what's in the image it might output a different prediction every time you click "Retry". With the temperature parameter you can control this behavior (low temperature will produce the same result).

Alternatively you can use pix2tex.py with similar functionality as gui.py, only as command line tool. In this case you don't need to install PyQt5. Using this script you can also parse already existing images from the disk.

Note: As of right now it works best with images of smaller resolution. Don't zoom in all the way before taking a picture. Double check the result carefully. You can try to redo the prediction with an other resolution if the answer was wrong.

Update: I have trained an image classifier on randomly scaled images of the training data to predict the original size. This model will automatically resize the custom image to best resemble the training data and thus increase performance of images found in the wild. To use this preprocessing step, all you have to do is download the second weights file mentioned above. You should be able to take bigger (or smaller) images of the formula and still get a satisfying result

Training the model

  1. First we need to combine the images with their ground truth labels. I wrote a dataset class (which needs further improving) that saves the relative paths to the images with the LaTeX code they were rendered with. To generate the dataset pickle file run
python dataset/dataset.py --equations path_to_textfile --images path_to_images --tokenizer path_to_tokenizer --out dataset.pkl

You can find my generated training data on the Google Drive as well (formulae.zip - images, math.txt - labels). Repeat the step for the validation and test data. All use the same label text file.

  1. Edit the data entry in the config file to the newly generated .pkl file. Change other hyperparameters if you want to. See settings/default.yaml for a template.
  2. Now for the actual training run
python train.py --config path_to_config_file

Model

The model consist of a ViT [1] encoder with a ResNet backbone and a Transformer [2] decoder.

Performance

BLEU score normed edit distance
0.88 0.10

Data

We need paired data for the network to learn. Luckily there is a lot of LaTeX code on the internet, e.g. wikipedia, arXiv. We also use the formulae from the im2latex-100k dataset. All of it can be found here

Fonts

Latin Modern Math, GFSNeohellenicMath.otf, Asana Math, XITS Math, Cambria Math

TODO

  • add more evaluation metrics
  • create a GUI
  • add beam search
  • support handwritten formulae
  • reduce model size (distillation)
  • find optimal hyperparameters
  • tweak model structure
  • fix data scraping and scrape more data
  • trace the model

Contribution

Contributions of any kind are welcome.

Acknowledgment

Code taken and modified from lucidrains, rwightman, im2markup, arxiv_leaks, pkra: Mathjax, harupy: snipping tool

References

[1] An Image is Worth 16x16 Words

[2] Attention Is All You Need

Comments
  • The result of retraining is not good

    The result of retraining is not good

    I clone the project , changed nothing. except change the train&val.pkl path in the config file , use your images retrain. but i think my result is not good . i check the data , found nothing . here is my trian PS img; XVM_9A6MKXS0I6KP(S88VS9

    i don't know how to check and find the problem

    training 
    opened by JaosonMa 41
  • Data parallelism【multi-gpu train】+pure ViT work + small modify

    Data parallelism【multi-gpu train】+pure ViT work + small modify

    pure ViT structure

    We discussed pure ViT structure at https://github.com/lukas-blecher/LaTeX-OCR/discussions/131 .

    1. Initially, I used a pure ViT (6ecc3f4). But the encoder was just not performing very well. The model produced latex code but it has nothing to do with the input image.

    And I do come up with same result, the model can't converge. In fact, I would hope that larger pure vit can achieve high performance, it really frustrated me. But in recent days, https://github.com/lukas-blecher/LaTeX-OCR/issues/147#issuecomment-1125837771 give me some idea, because the training loss curve is so familiar like pure vit training curve, so I think the reason why pure vit can't fit maybe due to batch size.

    I taken and modified models.py from 844bc219a9469fa7e9dfc8626f74a705bd194d69.

    Here is the good news, it's working.

    image

    How to use

    # for vit
     python -m pix2tex.train --config model/settings/config-vit.yaml --structure vit
    # for hybrid, default is hybrid
     python -m pix2tex.train --config model/settings/config.yaml --structure hybrid
     python -m pix2tex.train --config model/settings/config.yaml
    
    

    Data parallelism

    I think multi-GPU training can save more time and a larger batch size, so refer to some documents and blogs and make such changes. Also, it's compatible with one GPU.

    How to use

    #for one GPU
    export CUDA_VISIBLE_DEVICES=6
     python -m pix2tex.train --config model/settings/config-vit.yaml --structure vit
    #for multi GPU
    export CUDA_VISIBLE_DEVICES=6,7
     python -m pix2tex.train --config model/settings/config-vit.yaml --structure vit
    

    References:

    1. Technique 1: Data Parallelism
    2. data_parallel_tutorial.ipynb
    3. https://github.com/jytime/Mask_RCNN_Pytorch/issues/2#issuecomment-423718196

    small modify

    I think both hybrid and pure vit work together, why not put them together. so create a folder named as structures.


    the branch is based on 720978d8c469780ed070d041d5795c55b705ac1b, please feel free to correct any inappropriate code.😁

    enhancement 
    opened by TITC 28
  • PermissionError: [Errno 13] Permission denied

    PermissionError: [Errno 13] Permission denied

    When I run latexocr in Windows Terminal, I got this error:

    Traceback (most recent call last):
      File "F:\Python\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "F:\Python\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "F:\Venv\pytorch_1.11\Scripts\latexocr.exe\__main__.py", line 7, in <module>
      File "F:\Venv\pytorch_1.11\lib\site-packages\pix2tex\gui.py", line 316, in main
        with in_model_path():
      File "F:\Python\lib\contextlib.py", line 119, in __enter__
        return next(self.gen)
      File "F:\Venv\pytorch_1.11\lib\site-packages\pix2tex\utils\utils.py", line 161, in in_model_path
        with path('pix2tex', 'model') as model_path:
      File "F:\Python\lib\contextlib.py", line 119, in __enter__
        return next(self.gen)
      File "F:\Python\lib\importlib\resources.py", line 175, in _path_from_reader
        opener_reader = reader.open_resource(norm_resource)
      File "<frozen importlib._bootstrap_external>", line 1055, in open_resource
    PermissionError: [Errno 13] Permission denied: 'F:\\Venv\\pytorch_1.11\\lib\\site-packages\\pix2tex\\model'
    
    help wanted windows 
    opened by calmisential 12
  • Re: Completely unusable

    Re: Completely unusable

    Hello!

    I am currently on macOS catalina 10.15.7, running python3.7. I went through the installation, and met the same problem as described in #33. I have tried all the fixes, including downgrading x-transformers, tuning the temperature, taking pictures of larger equations, and downloading the weights.pth and image_resizer.pth into the checkpoints folder, yet the program still gives out wrong results. Is there possibly some incompatibility with other distributions for my mac?

    Here are my installed packages.

    song12301(Jeb) ~ % pip3 list
    Package                              Version
    ------------------------------------ ---------
    albumentations                       1.1.0
    certifi                              2021.10.8
    chardet                              4.0.0
    charset-normalizer                   2.0.10
    click                                8.0.3
    Cython                               0.29.26
    einops                               0.4.0
    entmax                               1.0
    filelock                             3.4.2
    idna                                 3.3
    imageio                              2.14.0
    imagesize                            1.3.0
    joblib                               1.1.0
    munch                                2.5.0
    networkx                             2.6.3
    numpy                                1.22.1
    opencv-python-headless               4.5.5.62
    packaging                            21.3
    pandas                               1.4.0
    Pillow                               9.0.0
    pip                                  21.3.1
    pynput                               1.7.6
    pyobjc-core                          8.1
    pyobjc-framework-ApplicationServices 8.1
    pyobjc-framework-Cocoa               8.1
    pyobjc-framework-Quartz              8.1
    pyparsing                            3.0.7
    PyQt5                                5.15.6
    PyQt5-Qt5                            5.15.2
    PyQt5-sip                            12.9.0
    PyQtWebEngine                        5.15.5
    PyQtWebEngine-Qt5                    5.15.2
    python-dateutil                      2.8.2
    python-Levenshtein                   0.12.2
    pytz                                 2021.3
    PyWavelets                           1.2.0
    PyYAML                               6.0
    qudida                               0.0.4
    regex                                2022.1.18
    requests                             2.27.1
    sacremoses                           0.0.47
    scikit-image                         0.19.1
    scikit-learn                         1.0.2
    scipy                                1.7.3
    screeninfo                           0.8
    setuptools                           60.5.0
    six                                  1.16.0
    threadpoolctl                        3.0.0
    tifffile                             2021.11.2
    timm                                 0.5.4
    tokenizers                           0.9.4
    torch                                1.10.1
    torchtext                            0.11.1
    torchvision                          0.11.2
    tqdm                                 4.62.3
    typing_extensions                    4.0.1
    urllib3                              1.26.8
    wheel                                0.37.1
    wincertstore                         0.2
    x-transformers                       0.12.1
    

    Thanks a lot for your time!

    opened by jeb12301 11
  • generate the cromhe tokenizer.json  ,error,how to fix it ?

    generate the cromhe tokenizer.json ,error,how to fix it ?

    (tf_1.12) root@f15b165683e6:/home/code/LaTeX-OCR# python dataset/dataset.py --equations latex-ocr-data/crohme/CROHME_math.txt --vocab-size 8000 --out crohme-tokenizer.json Generate tokenizer Traceback (most recent call last): File "dataset/dataset.py", line 244, in generate_tokenizer(args.equations, args.out, args.vocab_size) File "dataset/dataset.py", line 228, in generate_tokenizer trainer = BpeTrainer(special_tokens=["[PAD]", "[BOS]", "[EOS]"], vocab_size=vocab_size, show_progress=True) TypeError: 'str' object cannot be interpreted as an integer (tf_1.12) root@f15b165683e6:/home/code/LaTeX-OCR# how to fix it ?

    question 
    opened by aspnetcs 11
  • how to convert my own latex line to yours like math.txt?

    how to convert my own latex line to yours like math.txt?

    here is my own latex data line ,there is no space . image here is you math.txt latex line, there is lots of sapce in the line , image i want to konw how to convert my own latex line to you style?

    opened by JaosonMa 10
  • some suggestions

    some suggestions

    1. normalization influenced by alpha.
    grayscale = (data[..., 0]-data[..., 0].min()) / (data[..., 0].max()-data[..., 0].min())*255
    
    1. paste size does not match
    padded.paste(im, (0, 0, im.size[0], im.size[1]))
    
    1. pad wrong pixel when text is inverted cause the text has inverted some times, but the padded pixel is hard code to 255
    padded = Image.new('L', dims, 255)
    

    I notice this will cause error recognition when the text's pixel is 255 and the pad pixel is also 255, then that pad part will be recognized as text.

    opened by TITC 10
  • PIL TypeError

    PIL TypeError

    Hi, I constantly get a TypeError when trying to run gui.py.

    Traceback (most recent call last):
      File "/Applications/LaTeX-OCR-main/gui.py", line 266, in mouseReleaseEvent
        img = ImageGrab.grab(bbox=(x1, y1, x2, y2), all_screens=True)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PIL/ImageGrab.py", line 42, in grab
        im_resized = im.resize((right - left, bottom - top))
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PIL/Image.py", line 2040, in resize
        im = im.resize(size, resample, box)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PIL/Image.py", line 2062, in resize
        return self._new(self.im.resize(size, resample, box))
    TypeError: integer argument expected, got float
    zsh: abort      '/usr/local/bin/python3.8' '/Applications/LaTeX-OCR-main/gui.py'
    phil@Air-von-Phil LaTeX-OCR-main % 
    

    Pix2Tex works, even though I get an unsupported hardware notification. I'm on a M1 MacBook Air. Any help would be great. Kind regards

    gui macOS 
    opened by PhilP88 9
  • Issue in Generate Tokenizer for CROHME dataset

    Issue in Generate Tokenizer for CROHME dataset

    Hey Buddy, first of all, great work here, I followed the instructions, and it works amazingly for most of the equations. Now I want to train the model for handwritten equations to predict LaTeX. Following README.MD, I'm trying to generate the tokenizer for the CROHME dataset for which I entered the following command:

    python dataset/dataset.py --equations dataset/CROHME_math.txt --vocab-size 8000 --out tokenizer.json

    I'm getting the following error:

    Generate tokenizer
    Traceback (most recent call last):
      File "C:\Users\Saad\OneDrive\Desktop\LaTeX-OCR-main\dataset\dataset.py", line 244, in <module>
        generate_tokenizer(args.equations, args.out, args.vocab_size)
      File "C:\Users\Saad\OneDrive\Desktop\LaTeX-OCR-main\dataset\dataset.py", line 228, in generate_tokenizer     
        trainer = BpeTrainer(special_tokens=["[PAD]", "[BOS]", "[EOS]"], vocab_size=vocab_size, show_progress=True)
    TypeError: 'str' object cannot be interpreted as an integer
    

    How am I to solve this? I'm assuming that I'll first generate the tokenizer.json file and then train the model on CROHME Dataset. Once I'm done, I'll be able to input handwritten equations and get the corresponding LaTeX. Am I on the right track? Thanks!

    opened by Agha-Muqarib 9
  • Image grab not supported in Linux

    Image grab not supported in Linux

    Take a snapshot of the clipboard image, if any. Only macOS and Windows are currently supported. https://pillow.readthedocs.io/en/stable/reference/ImageGrab.html#PIL.ImageGrab.grabclipboard

    pix2tex.py uses this method but it is not supported in Linux. Need to find a workaround.

    opened by lukas-blecher 9
  • "--no-cuda" does not work

    When using the --no-cuda argument, it returns an error.

    (env) λ python pix2tex.py --no-cuda
    Traceback (most recent call last):
      File "H:\pytlat\ocr\pix2tex.py", line 84, in <module>
        args, model, tokenizer = initialize(args)
      File "H:\pytlat\ocr\pix2tex.py", line 33, in initialize
        model.load_state_dict(torch.load(args.checkpoint))
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 594, in load
        return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 853, in _load
        result = unpickler.load()
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 845, in persistent_load
        load_tensor(data_type, size, key, _maybe_decode_ascii(location))
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 834, in load_tensor
        loaded_storages[key] = restore_location(storage, location)
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 175, in default_restore_location
        result = fn(storage, location)
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 151, in _cuda_deserialize
        device = validate_cuda_device(location)
      File "H:\pytlat\env\lib\site-packages\torch\serialization.py", line 135, in validate_cuda_device
        raise RuntimeError('Attempting to deserialize object on a CUDA '
    RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
    

    I use torch 1.7.+cpu, cuda version is not installed, and can't use cuda.

    opened by KIVix 9
  • When I try to recognize a series of equations, I get an error

    When I try to recognize a series of equations, I get an error

    When I try to recognize a series of equations, I get an error,

    here is the equations image.

    image

    here is the result.

    image

    Is there any way to fix this error? Thank you for taking the time to look at this issue and reply to it.

    opened by luis-arch 1
  • Possible bug in computing positional embeddings for patches

    Possible bug in computing positional embeddings for patches

    Hi all - currently looking into fine-tuning this model and have run into an issue with images of varying different sizes. For this example:

    max_height = 192, max_width = 672, patch_size=16

    The error causing line is here:

            x += self.pos_embed[:, pos_emb_ind]
    

    (pix2tex.models.hybrid line 25 in CustomVisionTransformer forward_features)

    If I have an image of size 522 x 41, this line will throw an error. X consists of 99 patches (+ the cls tokens) making it size [100, 256]

    However, the positional embedding indices are only 66 in length. I am currently investigating this issue but don't quite understand the formula used to compute how many positional embedding indicies we are going to need. Right now it is computing 66 different indicies when we should be getting 100 different indicies. I think the issue arises when convolutions from the resnet embedder overlap and the formula doesn't account for this (it requires the image to be divisible by patch_size X patch_size for this formula to work).

    If anyone has any thoughts on how to fix this let me know! I'm definitely no computer vision expert but I believe a simple change to account for overlapping convolutions in the embedding may be enough to fix this!

    opened by ByrdOfAFeather 1
  • Effect of resolution

    Effect of resolution

    Sorry to bother you again. I found that different resolution of an image will have a big impact on the recognition effect. For example, if the original resolution of some input images is reduced to 80% or enlarged to 120 percent, the recognition effect will change significantly, and the identification results will be too uncertain.

    opened by with-him777 4
  • formula recognition

    formula recognition

    There are some errors in formula recognition. 12 11 The following are the results of the identification: y=\prod x_{i}^{v}
    y=\sum w_{i} x These are the images generated in cli.py: 12 11

    opened by with-him777 4
  • How can I generate training data ?

    How can I generate training data ?

    As you've mentioned, to generate dataset the command should go like this "python -m pix2tex.dataset.dataset --equations path_to_textfile --images path_to_images --out dataset.pkl" and the dataset class basically takes the filename and splits it from "." and takes that first splited part as the line number of the equation file and grab that line as the ground truth data of the image.(Correct me if I'm wrong). My question is how can I generate my own dataset to train the model. Is it necessary to have "000" kind of stuffs before the file name of the image ? Because your google drive data is kind of confusing ! it contains

    1. Train Images -> 158480 number of files
    2. Valid Images -> 6780 number of files
    3. Test Images -> 30637 number of files 195882 Files in total but your ground truth data contains more than that. I found 234484 lines in math.txt file . Can you please explain how can align my own data to generate the dataset.pkl file. Or how can I name the image files and how can I write my math.txt file ?
    opened by Rahul99887trt 1
Releases(0.0.29)
  • 0.0.29(Sep 25, 2022)

    What's Changed

    GUI and CLI improvements.

    • use same parser to parse cli and gui arguments by @Freed-Wu in https://github.com/lukas-blecher/LaTeX-OCR/pull/179
    • add support for readline by @Freed-Wu in https://github.com/lukas-blecher/LaTeX-OCR/pull/185
    • Fix #184, add highlight by @Freed-Wu in https://github.com/lukas-blecher/LaTeX-OCR/pull/186
    • Use gnome-screenshot automatically by @Freed-Wu in https://github.com/lukas-blecher/LaTeX-OCR/pull/188
    • Fix --file and support expanding ~ by @Freed-Wu in https://github.com/lukas-blecher/LaTeX-OCR/pull/187
    • Solved Retina display issues by @FrankFrank9 in https://github.com/lukas-blecher/LaTeX-OCR/pull/195
    • Update Snip button on MacOs by @FrankFrank9 in https://github.com/lukas-blecher/LaTeX-OCR/pull/196
    • Make gui better and fix bug of QWebEngine doesn't display eq on linux by @muyuuuu in https://github.com/lukas-blecher/LaTeX-OCR/pull/190

    New Contributors

    • @Freed-Wu made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/179
    • @FrankFrank9 made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/195
    • @muyuuuu made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/190

    Full Changelog: https://github.com/lukas-blecher/LaTeX-OCR/compare/0.0.26...0.0.29

    Source code(tar.gz)
    Source code(zip)
  • 0.0.26(May 20, 2022)

    What's Changed

    Mainly improved training

    • add micro batches by @lukas-blecher in https://github.com/lukas-blecher/LaTeX-OCR/pull/148
    • Data parallelism + pure ViT working by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/150

    Full Changelog: https://github.com/lukas-blecher/LaTeX-OCR/compare/0.0.24...0.0.26

    Breaking Changes

    models.py moved into new module models. Model class has forward moved to generate.

    Source code(tar.gz)
    Source code(zip)
  • 0.0.24(May 3, 2022)

    What's Changed

    • Better dataset render pipeline by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/141
    • Add some documentation by @lukas-blecher in https://github.com/lukas-blecher/LaTeX-OCR/pull/142
    • Add docker image for API by @lukas-blecher in https://github.com/lukas-blecher/LaTeX-OCR/pull/143

    Full Changelog: https://github.com/lukas-blecher/LaTeX-OCR/compare/0.0.20...0.0.24

    Source code(tar.gz)
    Source code(zip)
  • 0.0.20(Apr 27, 2022)

    What's Changed

    • Add Api by @lukas-blecher in https://github.com/lukas-blecher/LaTeX-OCR/pull/140 The new functionality is built on new dependenciew. They can be installed by using the [api] or [all] tag when installing pix2tex[tag]
    • LaTeX-OCR/dataset to LaTeX-OCR/pix2tex/dataset by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/123
    • import problem by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/125
    • preprocessing file missing by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/135

    Breaking Changes

    Methods in cli.py initialize and call_model have been moved into a the class LatexOCR.

    Full Changelog: https://github.com/lukas-blecher/LaTeX-OCR/compare/0.0.4...0.0.20

    Source code(tar.gz)
    Source code(zip)
  • 0.0.4(Apr 13, 2022)

    What's Changed

    • Add desktop entry script for the GUI by @JCGoran in https://github.com/lukas-blecher/LaTeX-OCR/pull/34
    • :hammer: fix the image resize in pix2tex.call_model by @rainyl in https://github.com/lukas-blecher/LaTeX-OCR/pull/105
    • alpha bug fixes by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/112
    • [Feature] Add a cmdline option to use gnome-screenshot instead of pyqt to capture screenshots by @kxxt in https://github.com/lukas-blecher/LaTeX-OCR/pull/111
    • img has been cut off abnormally by @TITC in https://github.com/lukas-blecher/LaTeX-OCR/pull/119
    • Install via PyPI by @lukas-blecher in https://github.com/lukas-blecher/LaTeX-OCR/pull/121

    New Contributors

    • @JCGoran made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/34
    • @rainyl made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/105
    • @TITC made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/112
    • @kxxt made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/111
    • @frankier made their first contribution in https://github.com/lukas-blecher/LaTeX-OCR/pull/94

    Full Changelog: https://github.com/lukas-blecher/LaTeX-OCR/compare/v0.0.1...0.0.4

    No new model checkpoints. See first release.

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Oct 28, 2021)

Owner
Lukas Blecher
Physics student at Heidelberg University, interested in machine learning
Lukas Blecher
Simple Python package to convert an image into a quantized image using a customizable palette

Simple Python package to convert an image into a quantized image using a customizable palette. Resulting image can be displayed by ePaper displays such as Waveshare displays.

Luis Obis 3 Apr 13, 2022
Glyph-graph - A simple, yet versatile, package for graphing equations on a 2-dimensional text canvas

Glyth Graph Revision for 0.01 A simple, yet versatile, package for graphing equations on a 2-dimensional text canvas List of contents: Brief Introduct

Ivan 2 Oct 21, 2022
A functional and efficient python implementation of the 3D version of Maxwell's equations

py-maxwell-fdfd Solving Maxwell's equations via A python implementation of the 3D curl-curl E-field equations. This code contains additional work to e

Nathan Zhao 12 Dec 11, 2022
A Icon Maker GUI Made - Convert your image into icon ( .ico format ).

Icon-Maker-GUI A Icon Maker GUI Made Using Python 3.9.0 . It will take any image and convert it to ICO file, for web site favicon or Windows applicati

Insanecodes 12 Dec 15, 2021
Convert any image into greyscale ASCII art.

Image-to-ASCII Convert any image into greyscale ASCII art.

Ben Smith 12 Jan 15, 2022
This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character.

Room Formatter This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character. There is cur

Thomas Landstra 1 Nov 13, 2021
A little Python tool to convert a TrueType (ttf/otf) font into a PNG for use in demos.

font2png A little Python tool to convert a TrueType (ttf/otf) font into a PNG for use in demos. To use from command line it expects python3 to be at /

Rich Elmes 3 Dec 22, 2021
Xmas-Tree-GIF-Tool - Convert any given animated gif file into an animation in GIFT CSV format

This repo is made to participate in Matt Parker's XmasTree 2021 event. Convert a

Aven Zitzelberger 2 Dec 30, 2021
👾 Python project to help you convert any image into a pixel art.

?? Pixel Art Generator Python project to help you convert any image into a pixel art. ⚙️ Developer's Guide Things you need to get started with this co

Atul Anand 6 Dec 14, 2022
Convert bitmap images to seeds for Tiny-83 NFT project.

What is this? This tool allows you to convert any 14p high and 22p wide Bitmap (.bmp) to the seed needed for the Tiny-83 NFT project. Project Twitter:

shib_maximalist 1 Oct 31, 2021
Png2Jpg tool will help you convert from png image format to jpg images format.

PNG 2 JPG All codes assume running from root directory. Please update the sys path at the beginning of the codes before running. Over View Png2Jpg too

Nguyễn Trường Lâu 2 Dec 27, 2021
Tweet2Image - Convert tweets to Instagram-friendly images.

Convert tweets to Instagram-friendly images. How to use If you want to use this repository as a submodule, don't forget to put the fonts d

Janu Lingeswaran 1 Mar 11, 2022
Convert HDR photos taken by iPhone 12 (or later) to regular HDR images

heif-hdrgainmap-decode Convert HDR photos taken by iPhone 12 (or later) to regular HDR images. Installation First, make sure you have the following pa

Star Brilliant 5 Nov 13, 2022
An python script to convert images to upscaled versions made out of one-colour emojis.

ABOUT This is an python script to convert png, jpg and gif(output isnt animated :( ) images to scaled versions made out of one-colour emojis. Please n

null 0 Oct 19, 2022
Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures.

WADs Out For [The] Ladies Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures. Development mostly focused on L

null 5 Apr 9, 2022
Converting Images Into Minecraft Houses

Converting Images Into Minecraft Houses In this particular project, we turned a 2D Image into Minecraft pixel art and then scaled it in 3D such that i

Mathias Oliver Valdbjørn Jørgensen 1 Feb 2, 2022
missing-pixel-filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled.

Missing Pixel Filler This is the official code repository for the Missing Pixel Filler by SpaceML. missing-pixel-filler is a python package that, give

SpaceML 11 Jul 19, 2022
Convert the SVG code to PNG and replace the line by a call to the image in markdown

Convert the SVG code to PNG and replace the line by a call to the image in markdown

null 6 Sep 6, 2022
Convert Image to ASCII Art

Convert Image to ASCII Art Persiapan aplikasi ini menggunakan bahasa python dan beberapa package python. oleh karena itu harus menginstall python dan

Huda Damar 48 Dec 20, 2022