Cython plugin for Lark, reimplementing the LALR parser & lexer for better performance

Overview

Lark-Cython

Cython plugin for Lark, reimplementing the LALR parser & lexer for better performance on CPython.

Install:

pip install lark-cython

Usage:

import lark_cython

parser = Lark(grammar, parser="lalr", _plugins=lark_cython.plugins)

# Use Lark as you usually would, with a huge performance boost

See the examples for more.

Differences from Lark

  • Token instances do not inherit from str. You must use the value attribute to get the string.

Other caveats

  • Postlexer isn't currently implemented

Speed

In current benchmarks, lark-cython is about 50% to 80% faster than Lark.

We're still in the early stages, and in the future, lark-cython might go a lot faster.

Other

License: MIT

Author: Erez Shinan

Special thanks goes to Datafold for commissioning the draft for lark-cython, and allowing me to relase it as open-source.

Comments
  • Actions for sdist and pypi deployment

    Actions for sdist and pypi deployment

    Next step to hopefully get this on pypi (and letting me declare it as a dependency in my projects).

    This adds two new actions to deploy to the test pypi server and to deploy to the live pypi server. There is a third new step that also builds source distributions, so any platform with a compiler can pip install this even if the wheels don't directly support it (which probably isn't too many people).

    I haven't used the gh-action-pypi-publish action yet, so this may not work (I have custom publishing logic that also signs my wheels with a CI gpg key), but it should be too hard to debug.

    @erezsh To support this it would be helpful if you could generate a token for test.pypi.org (you may need to create an account if you don't have one, it's distinct from pypi.org) and then populate the TEST_PYPI_API_TOKEN secret with that token. When that works, you can do the same for regular pypi.

    The logic is setup such authorized PRs will try to publish to test.pypi. When you want to make a release, you would generate a new git tag (which can be done via the github release process), and the live pypi action will run when it sees a new tag.

    opened by Erotemic 15
  • Add support for building wheels on CI

    Add support for building wheels on CI

    I found out that only the source is published to pypi and not the wheels. It shouldn't be too difficult to get cibuildwheel working on this repo and then publishing those to pypi. It will also close #2

    opened by Erotemic 15
  • Meta is always empty while using cython lark

    Meta is always empty while using cython lark

    This is my parser:

        lark_kwargs = {
            "parser": "lalr",
            "lexer": "contextual",
            "propagate_positions": True,
            "_plugins": lark_cython.plugins,
        }
        lang_parser = Lark(lang_def, start="start", **lark_kwargs)
    

    I'd like to propagate the line positions, without cython-lark it works fine, but once i enable the plugins the meta value is always empty.

    Do you have any suggestion on what's wrong ?

    opened by ernestoarbitrio 9
  • fix UnexpectedToken handling exception

    fix UnexpectedToken handling exception

    I don't know if this is the correct solution but it fixes the case described below

    👇🏽

    with a grammar like:

    display_decimals: "DECIMALS"i WS INT
    start: display_decimals
    %import common (INT, WS)
    

    and a script like

    script = """
          bla
    """
    

    It raises

    *** AttributeError: 'lark_cython.lark_cython.LexerThread' object has no attribute '_Token'
    

    This PR handle the right exception when the token is wrong rather than raising an Attribute error.

    opened by ernestoarbitrio 4
  • Resolve differences from Lark

    Resolve differences from Lark

    Suggestion

    I mentioned the differences from Lark, is there any way to resolve? Describe alternatives you've considered Deploy from lark without any changes

    enhancement 
    opened by wqh17101 4
  • Setting non-string values on Tokens

    Setting non-string values on Tokens

    Token values in lark_cython are typed as str.

    In my TransformerI'm changing the token values to their correct types, for example int:

        def int(self, t):
            v = t[0]
            v.value = int(v.value)
            # return full Token rather than an int as Token properties are required later
            return v
    

    This throws the following error in lark_cython:

    lark_cython\lark_cython.pyx:20: in lark_cython.lark_cython.Token.value.__set__  TypeError: Expected unicode, got int
    

    I return the full token in the transformer, rather than simply an int value, as later logic(for error handling etc.) takes advantage of the token properties:

    line, column = key_token.line, key_token.column
    

    Do token values have to be strings in lark_cython? If so, is there any approach which would allow token values to be converted to support int, float etc.?

    question 
    opened by geographika 3
  • how to install lark_cython on windows

    how to install lark_cython on windows

    Describe the bug

    install lark_cython on windows

      lark_cython.obj : error LNK2001: unresolved external symbol __imp__PyClassMethod_New
      lark_cython.obj : error LNK2001: unresolved external symbol __imp__PyList_Type
      lark_cython.obj : error LNK2001: unresolved external symbol __imp__PyDict_GetItemString
    ...
    

    To Reproduce

    pip install lark-cython

    What do i need to install if i want to install on Windows

    opened by wqh17101 3
  • Bump actions/setup-python from 4.3.0 to 4.3.1

    Bump actions/setup-python from 4.3.0 to 4.3.1

    Bumps actions/setup-python from 4.3.0 to 4.3.1.

    Release notes

    Sourced from actions/setup-python's releases.

    Improve error handling and messages

    In scope of this release we added improved error message to put operating system and its version in the logs (actions/setup-python#559). Besides, the release

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump pypa/cibuildwheel from 2.11.2 to 2.11.3

    Bump pypa/cibuildwheel from 2.11.2 to 2.11.3

    Bumps pypa/cibuildwheel from 2.11.2 to 2.11.3.

    Release notes

    Sourced from pypa/cibuildwheel's releases.

    v2.11.3

    • ✨ Improves the 'build options' log output that's printed at the start of each run (#1352)
    • ✨ Added a friendly error message to a common misconfiguration of the CIBW_TEST_COMMAND option - not specifying path using the {project} placeholder (#1336)
    • 🛠 The GitHub Action now uses Powershell on Windows to avoid occasional incompabilities with bash (#1346)
    Changelog

    Sourced from pypa/cibuildwheel's changelog.

    v2.11.3

    5 Dec 2022

    • ✨ Improves the 'build options' log output that's printed at the start of each run (#1352)
    • ✨ Added a friendly error message to a common misconfiguration of the CIBW_TEST_COMMAND option - not specifying path using the {project} placeholder (#1336)
    • 🛠 The GitHub Action now uses Powershell on Windows to avoid occasional incompabilities with bash (#1346)
    Commits
    • a34a6b0 Bump version: v2.11.3
    • 61b6cc8 Merge pull request #1352 from pypa/improve-preamble
    • ecce3d9 Merge pull request #1336 from pypa/test-cwd-error-message
    • 63ef1b0 Merge pull request #1366 from pypa/pre-commit-ci-update-config
    • ba9a82e [pre-commit.ci] pre-commit autoupdate
    • 46372e1 Merge pull request #1364 from pypa/dependabot/github_actions/pypa/gh-action-p...
    • a157a51 Use a unittest style test to support more test runners
    • 9850864 Rename 'environ' to 'env'
    • 56359fb Apply suggestions from code review
    • 99f62f5 build(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.6.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump pypa/cibuildwheel from 2.11.3 to 2.11.4

    Bump pypa/cibuildwheel from 2.11.3 to 2.11.4

    Bumps pypa/cibuildwheel from 2.11.3 to 2.11.4.

    Release notes

    Sourced from pypa/cibuildwheel's releases.

    v2.11.4

    • 🐛 Fix a bug that caused missing wheels on Windows when a test was skipped using CIBW_TEST_SKIP (#1377)
    • 🛠 Updates CPython 3.11 to 3.11.1 (#1371)
    • 🛠 Updates PyPy 3.7 to 3.7.10, except on macOS which remains on 7.3.9 due to a bug. (#1371)
    • 📚 Added a reference to abi3audit to the docs (#1347)
    Changelog

    Sourced from pypa/cibuildwheel's changelog.

    v2.11.4

    24 Dec 2022

    • 🐛 Fix a bug that caused missing wheels on Windows when a test was skipped using CIBW_TEST_SKIP (#1377)
    • 🛠 Updates CPython 3.11 to 3.11.1 (#1371)
    • 🛠 Updates PyPy to 7.3.10, except on macOS which remains on 7.3.9 due to a bug on that platform. (#1371)
    • 📚 Added a reference to abi3audit to the docs (#1347)
    Commits
    • 27fc88e Bump version: v2.11.4
    • a7e9ece Merge pull request #1371 from pypa/update-dependencies-pr
    • b9a3ed8 Update cibuildwheel/resources/build-platforms.toml
    • 3dcc2ff fix: not skipping the tests stops the copy (Windows ARM) (#1377)
    • 1c9ec76 Merge pull request #1378 from pypa/henryiii-patch-3
    • 22b433d Merge pull request #1379 from pypa/pre-commit-ci-update-config
    • 98fdf8c [pre-commit.ci] pre-commit autoupdate
    • cefc5a5 Update dependencies
    • e53253d ci: move to ubuntu 20
    • e9ecc65 [pre-commit.ci] pre-commit autoupdate (#1374)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump actions/setup-python from 4.3.1 to 4.4.0

    Bump actions/setup-python from 4.3.1 to 4.4.0

    Bumps actions/setup-python from 4.3.1 to 4.4.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add support to install multiple python versions

    In scope of this release we added support to install multiple python versions. For this you can try to use this snippet:

        - uses: actions/setup-python@v4
          with:
            python-version: |
                3.8
                3.9
                3.10
    

    Besides, we changed logic with throwing the error for GHES if cache is unavailable to warn (actions/setup-python#566).

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Add python/cython benchmark for the lark parser

    Add python/cython benchmark for the lark parser

    @erezsh I appreciate you pointing me to this repo earlier.

    I was able to demonstrate about a 2x speedup for my specific DSL, but I was curious what that speedup was more generally, and I as also looking for a nice way to quantify if any chances to the Cython code would provide further speedups.

    I took a peek at the Cython code and I think it is ripe for optimization. Python types are being used everywhere, and if we were able to refactor those with pure C types, then I think there could be a large speed gain. Unfortunately, I'm not the greatest Cython coder, so I wasn't able to make any simple changes that did anything.

    However, I did write a reproducible benchmark to quantify the speedup between CPython-lark, and Cython-Lark over a range of input sizes.

    The timing module I use is timerit (which I wrote). It works similarly to timeit, but can work inline in existing code. I also use pandas, matplotlib, and seaborn to generate a nice figure showing the speedup over different input sizes.

    image

    The stdout of the script is:

    Timed best=1.144 ms, mean=1.704 ± 0.4 ms for method=parse_python,size=16
    Timed best=5.974 ms, mean=9.279 ± 1.5 ms for method=parse_python,size=87
    Timed best=10.813 ms, mean=17.676 ± 2.1 ms for method=parse_python,size=158
    Timed best=16.715 ms, mean=25.435 ± 3.1 ms for method=parse_python,size=229
    Timed best=20.364 ms, mean=31.777 ± 4.4 ms for method=parse_python,size=299
    Timed best=19.721 ms, mean=37.681 ± 8.5 ms for method=parse_python,size=370
    Timed best=23.847 ms, mean=47.875 ± 7.2 ms for method=parse_python,size=441
    Timed best=29.769 ms, mean=47.659 ± 11.1 ms for method=parse_python,size=512
    Timed best=0.751 ms, mean=1.226 ± 0.2 ms for method=parse_cython,size=16
    Timed best=4.176 ms, mean=6.391 ± 0.7 ms for method=parse_cython,size=87
    Timed best=7.068 ms, mean=11.063 ± 1.5 ms for method=parse_cython,size=158
    Timed best=8.398 ms, mean=13.830 ± 3.0 ms for method=parse_cython,size=229
    Timed best=11.037 ms, mean=19.378 ± 4.7 ms for method=parse_cython,size=299
    Timed best=13.332 ms, mean=25.704 ± 4.5 ms for method=parse_cython,size=370
    Timed best=14.691 ms, mean=25.771 ± 6.9 ms for method=parse_cython,size=441
    Timed best=20.890 ms, mean=31.757 ± 6.4 ms for method=parse_cython,size=512
    
    Statistics:
                                       min style_key size_key              hue_key        method  size      mean
    key                                                                                                         
    method=parse_cython,size=16   0.000751        {}       {}  method=parse_cython  parse_cython    16  0.001226
    method=parse_python,size=16   0.001144        {}       {}  method=parse_python  parse_python    16  0.001704
    method=parse_cython,size=87   0.004176        {}       {}  method=parse_cython  parse_cython    87  0.006391
    method=parse_python,size=87   0.005974        {}       {}  method=parse_python  parse_python    87  0.009279
    method=parse_cython,size=158  0.007068        {}       {}  method=parse_cython  parse_cython   158  0.011063
    method=parse_cython,size=229  0.008398        {}       {}  method=parse_cython  parse_cython   229  0.013830
    method=parse_python,size=158  0.010813        {}       {}  method=parse_python  parse_python   158  0.017676
    method=parse_cython,size=299  0.011037        {}       {}  method=parse_cython  parse_cython   299  0.019378
    method=parse_cython,size=370  0.013332        {}       {}  method=parse_cython  parse_cython   370  0.025704
    method=parse_cython,size=441  0.014691        {}       {}  method=parse_cython  parse_cython   441  0.025771
    method=parse_python,size=229  0.016715        {}       {}  method=parse_python  parse_python   229  0.025435
    method=parse_python,size=370  0.019721        {}       {}  method=parse_python  parse_python   370  0.037681
    method=parse_python,size=299  0.020364        {}       {}  method=parse_python  parse_python   299  0.031777
    method=parse_cython,size=512  0.020890        {}       {}  method=parse_cython  parse_cython   512  0.031757
    method=parse_python,size=441  0.023847        {}       {}  method=parse_python  parse_python   441  0.047875
    method=parse_python,size=512  0.029769        {}       {}  method=parse_python  parse_python   512  0.047659
    Speedup:
               min style_key size_key              hue_key        method      mean  speedup_mean  speedup_min
    size                                                                                                     
    16    0.000751        {}       {}  method=parse_cython  parse_cython  0.001226      1.390526     1.523632
    87    0.004176        {}       {}  method=parse_cython  parse_cython  0.006391      1.451871     1.430450
    158   0.007068        {}       {}  method=parse_cython  parse_cython  0.011063      1.597770     1.529840
    229   0.008398        {}       {}  method=parse_cython  parse_cython  0.013830      1.839145     1.990309
    299   0.011037        {}       {}  method=parse_cython  parse_cython  0.019378      1.639875     1.845177
    370   0.013332        {}       {}  method=parse_cython  parse_cython  0.025704      1.465973     1.479169
    441   0.014691        {}       {}  method=parse_cython  parse_cython  0.025771      1.857683     1.623239
    512   0.020890        {}       {}  method=parse_cython  parse_cython  0.031757      1.500740     1.425010
    Average speedup
                      mean       std       min       25%       50%       75%       max
    speedup_mean  1.592948  0.176645  1.390526  1.462448  1.549255  1.689692  1.857683
    speedup_min   1.605853  0.206135  1.425010  1.466989  1.526736  1.678723  1.990309
    

    This is also benchmarked against the lark.lark grammar that ships with lark. I have a helper function to generate a "random" (not really random, but it is simple) lark file to pass to the parser. One question I had was: Is there a way to use lark to generate a string from a grammar? If so that would make bench-marking more complex grammars much easier.

    Anyways, I hope this is helpful. Thanks again for this library!

    opened by Erotemic 10
Releases(0.0.14)
  • 0.0.14(Dec 6, 2022)

    What's Changed

    • Fix wheels by @Erotemic in https://github.com/lark-parser/lark_cython/pull/13
    • Small fix to adhere to Lark, due to error from Lark's InteractiveParser.accepts by @erezsh in https://github.com/lark-parser/lark_cython/pull/14
    • Fix InteractiveParser, with changes for Lark 1.1.5 (TBR) by @erezsh in https://github.com/lark-parser/lark_cython/pull/15

    Full Changelog: https://github.com/lark-parser/lark_cython/compare/0.0.13...0.0.14

    Source code(tar.gz)
    Source code(zip)
  • 0.0.13(Nov 7, 2022)

    What's Changed

    • add lark_meta dunder by @ernestoarbitrio in https://github.com/lark-parser/lark_cython/pull/10

    New Contributors

    • @ernestoarbitrio made their first contribution in https://github.com/lark-parser/lark_cython/pull/10

    Full Changelog: https://github.com/lark-parser/lark_cython/compare/0.0.12...0.0.13

    Source code(tar.gz)
    Source code(zip)
  • 0.0.11(Mar 1, 2022)

Owner
Lark - Parsing Library & Toolkit
Lark - Parsing Library & Toolkit
A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

stonepresto 4 Aug 13, 2022
Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

Lark - Parsing Library & Toolkit 3.5k Jan 5, 2023
Cython implementation of Toolz: High performance functional utilities

CyToolz Cython implementation of the toolz package, which provides high performance utility functions for iterables, functions, and dictionaries. tool

null 894 Jan 2, 2023
Get you an ultimate lexer generator using Fable; port OCaml sedlex to FSharp, Python and more!

NOTE: currently we support interpreted mode and Python source code generation. It's EASY to compile compiled_unit into source code for C#, F# and othe

Taine Zhao 15 Aug 6, 2022
Python bindings to the dutch NLP tool Frog (pos tagger, lemmatiser, NER tagger, morphological analysis, shallow parser, dependency parser)

Frog for Python This is a Python binding to the Natural Language Processing suite Frog. Frog is intended for Dutch and performs part-of-speech tagging

Maarten van Gompel 46 Dec 14, 2022
Py-Parser est un parser de code python en python encore en plien dévlopement.

PY - PARSER Py-Parser est un parser de code python en python encore en plien dévlopement. Une fois achevé, il servira a de nombreux projets comme glad

pf4 3 Feb 21, 2022
Lol qq parser - A League of Legends parser for QQ data

lol_qq_parser A League of Legends parser for QQ data Sources This package relies

Tolki 3 Jul 13, 2022
Discord bot-CTFD-Thread-Parser - Discord bot CTFD-Thread-Parser

Discord bot CTFD-Thread-Parser Description: This tools is used to create automat

null 15 Mar 22, 2022
Better-rtti-parser - IDA script to parse RTTI information in executable

RTTI parser Parses RTTI information from executable. Example HexRays decompiler view Before: After: Functions window Before: After: Structs window Ins

null 101 Jan 4, 2023
Just a small test with lists in cython

Test for lists in cython Algorithm create a list of 10^4 lists each with 10^4 floats values (namely: 0.1) - 2 nested for iterate each list and compute

Federico Simonetta 32 Jul 23, 2022
A PyTorch implementation of a Factorization Machine module in cython.

fmpytorch A library for factorization machines in pytorch. A factorization machine is like a linear model, except multiplicative interaction terms bet

Jack Hessel 167 Jul 6, 2022
orfipy is a tool written in python/cython to extract ORFs in an extremely and fast and flexible manner

Introduction orfipy is a tool written in python/cython to extract ORFs in an extremely and fast and flexible manner. Other popular ORF searching tools

Urminder Singh 34 Nov 21, 2022
An alternative serializer implementation for REST framework written in cython built for speed.

drf-turbo An alternative serializer implementation for REST framework written in cython built for speed. Free software: MIT license Documentation: htt

Mng 74 Dec 30, 2022
[Cython] Vs [Python] Which one is Faster ?

[Cython] Vs [Python] ? Attractive Contrast :) Mission : Which one is Faster ? Comparing of Execution runtime for [Selection_sort] with Time Complexity

baqer marani 1 Dec 5, 2021
Example for how to package a Python library based on Cython.

Cython sample module This project is an example of a module that can be built using Cython. It is an upgrade from a similar model developed by Arin Kh

Juan José García Ripoll 4 Aug 28, 2022
Learning recognition/segmentation models without end-to-end training. 40%-60% less GPU memory footprint. Same training time. Better performance.

InfoPro-Pytorch The Information Propagation algorithm for training deep networks with local supervision. (ICLR 2021) Revisiting Locally Supervised Lea

null 78 Dec 27, 2022
Pyramid R-CNN: Towards Better Performance and Adaptability for 3D Object Detection

Pyramid R-CNN: Towards Better Performance and Adaptability for 3D Object Detection

null 61 Jan 7, 2023
Yoloxkeypointsegment - An anchor-free version of YOLO, with a simpler design but better performance

Introduction 关键点版本:已完成 全景分割版本:已完成 实例分割版本:已完成 YOLOX is an anchor-free version of

null 23 Oct 20, 2022
❄️ A flake8 plugin to help you write better list/set/dict comprehensions.

flake8-comprehensions A flake8 plugin that helps you write better list/set/dict comprehensions. Requirements Python 3.6 to 3.9 supported. Installation

Adam Johnson 398 Dec 23, 2022
pytest plugin for a better developer experience when working with the PyTorch test suite

pytest-pytorch What is it? pytest-pytorch is a lightweight pytest-plugin that enhances the developer experience when working with the PyTorch test sui

Quansight 39 Nov 18, 2022