GithubHelp home page GithubHelp logo

tetra-quark / deeplabcut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deeplabcut/deeplabcut

0.0 0.0 0.0 159.81 MB

Official implementation of DeepLabCut: Markerless pose estimation of user-defined features with deep learning for all animals incl. humans

Home Page: http://deeplabcut.org

License: GNU Lesser General Public License v3.0

Python 99.22% Shell 0.76% Makefile 0.02%

deeplabcut's People

Contributors

alesantuz avatar alexemg avatar anandcpanchal avatar backyardbiomech avatar biol-jsh avatar bobfromjapan avatar ehsainit avatar gkane26 avatar hmaarrfk avatar imagejan avatar intergalacticmammoth avatar jchutrue avatar jeylau avatar katierupp avatar kngwyu avatar konraddanielewski avatar lambdaloop avatar louisadamian avatar ludovicbellier avatar luzpaz avatar mmathislab avatar n-poulsen avatar neslihanedes avatar rahulporuri avatar stes avatar sugyan avatar tetra-quark avatar timokleia avatar xdhmoore avatar yeshaokai avatar

deeplabcut's Issues

Refactor get CollectedData path to an auxiliary function

Search repo for "CollectedData_" for example usages. There are basially two types that need refactoring, those that specify the parent folder of the CollectedData file and the ones that get it from the labeled-data folder for the iteration. The function should ideally be able to deal with both cases but might actually need two functions.

Type 1:

    Data = pd.read_hdf(
        os.path.join(
            cfg["project_path"],
            str(trainingsetfolder),
            "CollectedData_" + cfg["scorer"] + ".h5",
        )
    )

becomes:

    Data = pd.read_hdf(
        get_collected_data_file_path(cfg),
    )

Type 2:

    os.path.join(str(folder), "CollectedData_" + cfg["scorer"] + ".csv")

Idea - Refactor config to dataclasses?

Is your feature request related to a problem? Please describe.

Currently the main project config and both pose config files are often accessed through a dictionary attribute in certain classes. They are usually simply called 'cfg' and thus it is difficult to know which config file is being used without looking at which keys are being accessed or having more knowledge of the context of the code. I believe improving this would add a lot to the clarity and maintainability of the DeepLabCut repository.

Describe the solution you'd like

I think it would be a lot cleaner to implement these config dict attributes as a dataclasses. The dataclass could remain an attribute of the class in which it is used.

Structuring the config like this could enable other classes such as Project or Model classes that can handle paths and creating, loading, updating files in a cleaner way. Could handle conversions and formatting that are done everytime the variable is loaded or accessed. Ex. store datetime easily converted to 'dd-mm-yyyy' is converted to 'JanYY'.

Pros:

  • Clarify what kind of config file is being used
  • Enable suggestions and auto-completion during development

Cons:

  • key-value pairs are added in the running code and are not part of any config file, need to handle that.
  • any backwards compatibility issues?

Need to think a bit more deeply about the structure and how it would work.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.