Giter VIP home page Giter VIP logo

granny's People

Contributors

nhanng24 avatar spficklin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

granny's Issues

Need graceful error for directories

When I accidentally provided a path that was not a directory I got the following error:

granny -i cli -d /local/projects/granny/demo/cross_section_images/cross_section_tray/cross_section_demo_image.jpeg -a segmentation
Traceback (most recent call last):
  File "/home/ficklin/.local/bin/granny", line 8, in <module>
    sys.exit(run())
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/GrannyBase.py", line 31, in run
    GrannyCLI(parser).run()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 101, in run
    images = self.listImages(self.image_dir)
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 61, in listImages
    image_files: List[str] = os.listdir(image_dir)
NotADirectoryError: [Errno 20] Not a directory: '/local/projects/granny/demo/cross_section_images/cross_section_tray/cross_section_demo_image.jpeg'

We need a more graceful error message to report to the user

Docker v1.0

We need a dockerized version of Granny to make it easy for folks to use Granny

Model is missing

When running granny with the demo data we seem to be missing the model for segmentation and we get the following error:

Traceback (most recent call last):
  File "/home/ficklin/.local/bin/granny", line 8, in <module>
    sys.exit(run())
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/GrannyBase.py", line 31, in run
    GrannyCLI(parser).run()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 110, in run
    analysis = aclass(images)
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Analyses/Segmentation.py", line 24, in __init__
    self.AIModel.loadModel()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Models/AIModel/YoloModel.py", line 25, in loadModel
    self.model = YOLO(self.model_dir)
  File "/home/ficklin/.local/lib/python3.10/site-packages/ultralytics/engine/model.py", line 134, in __init__
    self._load(model, task=task)
  File "/home/ficklin/.local/lib/python3.10/site-packages/ultralytics/engine/model.py", line 215, in _load
    self.model, self.ckpt = attempt_load_one_weight(weights)
  File "/home/ficklin/.local/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 709, in attempt_load_one_weight
    ckpt, weight = torch_safe_load(weight)  # load ckpt
  File "/home/ficklin/.local/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 634, in torch_safe_load
    ckpt = torch.load(file, map_location="cpu")
  File "/home/ficklin/.local/lib/python3.10/site-packages/torch/serialization.py", line 791, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/ficklin/.local/lib/python3.10/site-packages/torch/serialization.py", line 271, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/ficklin/.local/lib/python3.10/site-packages/torch/serialization.py", line 252, in __init__
    super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/ficklin/.local/lib/python3.10/site-packages/Granny/Analyses/config/Segmentation/granny_v1_yolo8.pt

Solution
We cannot package the model inside of the software. It's too big (~300MB). So, we need to put the model in a public repository so it can be downloaded. Perhaps that can be on the OSF (https://osf.io/). We should name the files in this way granny-v{granny_version}-{model_name}-v{model_version}.pt. We should add a new argument to the segmentation step that indicates where the model is located. If a local path is provided then the local model file is used. If a string of the form {model_name}-v{model_version} is provided, then Granny will download the model file from OSF, store it in the current directory and then use that model.

Default interface isn't working

Currently Granny gives the error if no arguments are provided

Error: unknown interface

By default it is supposed to use 'cli' as the default interface if none is provided

Move -d and -r from GrannyCLI to the Analysis class

For linking analysis in a worklfow we need to have the input directory and the output directory specified in an analysis. But also, let's rename them to the be --input_dir and --output_dir. Anything needed for an analysis must be in that directory.

Get Pear Color Analysis Working

This simply needs conversion over to the new MVC framework.

Hard-code the color rating color values in the analysis so the card doesn't need to be read in for the analysis to work. Also, add the color card image to the docs folder so we can refer to it in the documentation.

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.