Giter Club home page Giter Club logo

aniketmaurya / chitra Goto Github PK

View Code? Open in Web Editor NEW
224.0 6.0 37.0 22.86 MB

A multi-functional library for full-stack Deep Learning. Simplifies Model Building, API development, and Model Deployment.

Home Page: https://chitra.readthedocs.io/en/latest/

License: Apache License 2.0

Python 98.91% Makefile 0.81% Dockerfile 0.29%
tensorflow image-processing object-detection deep-learning image-dataset visualization gradcam model-interpretation model-visualization image-classification

chitra's Issues

cache downloaded images with `chitra.image.Chitra`

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

from chitra.image import Chitra

# image is downloaded from internet
image = Chitra(IMAGE_URL)

# same image is downloaded again!
image = Chitra(IMAGE_URL)

Describe the solution you'd like

Cache the image in local dir

What I want is -

from chitra.image import Chitra

# image is downloaded from internet
image = Chitra(IMAGE_URL, cache=True)

# image is loaded from cached dir
image = Chitra(IMAGE_URL, cache=True)

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.

Async Image loader

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

Fixed yielding rate in the generator

Problem

There is a limited data yield in the generator which stops data iteration (hence no data will now yield by generator) in 1 complete cycle. Limiting developer to reassess the same data twice in a loop.

Solution and Alternatives

Making the generator yields inexhaustible data and simultaneously adding training steps in model training.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Model Dockerization

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

Disconnected graph error in `InterpretModel`

Bug description

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-91-b64613cd9976> in <module>
----> 1 interpret(img.image, auto_resize=False)

~/miniconda3/envs/aniket/lib/python3.7/site-packages/chitra/trainer.py in __call__(self, image, auto_resize, image_size)
    352             X,
    353             penultimate_layer=-1,  # model.layers number
--> 354             seek_penultimate_conv_layer=True,
    355         )
    356         cam = normalize(cam)

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tf_keras_vis/gradcam.py in __call__(self, loss, seed_input, penultimate_layer, seek_penultimate_conv_layer, activation_modifier, expand_cam, training)
    148         # Processing gradcam
    149         model = tf.keras.Model(inputs=self.model.inputs,
--> 150                                outputs=self.model.outputs + [penultimate_output_tensor])
    151 
    152         with tf.GradientTape(watch_accessed_variables=False) as tape:

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
    515     self._self_setattr_tracking = False  # pylint: disable=protected-access
    516     try:
--> 517       result = method(self, *args, **kwargs)
    518     finally:
    519       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in __init__(self, inputs, outputs, name, trainable, **kwargs)
    118     generic_utils.validate_kwargs(kwargs, {})
    119     super(Functional, self).__init__(name=name, trainable=trainable)
--> 120     self._init_graph_network(inputs, outputs)
    121 
    122   @trackable.no_automatic_dependency_tracking

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
    515     self._self_setattr_tracking = False  # pylint: disable=protected-access
    516     try:
--> 517       result = method(self, *args, **kwargs)
    518     finally:
    519       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in _init_graph_network(self, inputs, outputs)
    202     # Keep track of the network's nodes and layers.
    203     nodes, nodes_by_depth, layers, _ = _map_graph_network(
--> 204         self.inputs, self.outputs)
    205     self._network_nodes = nodes
    206     self._nodes_by_depth = nodes_by_depth

~/miniconda3/envs/aniket/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in _map_graph_network(inputs, outputs)
    988                              'The following previous layers '
    989                              'were accessed without issue: ' +
--> 990                              str(layers_with_complete_input))
    991         for x in nest.flatten(node.outputs):
    992           computable_tensors.add(id(x))

ValueError: Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 512, 512, 3), dtype=tf.float32, name='input_1'), name='input_1', description="created by layer 'input_1'") at layer "rescaling". The following previous layers were accessed without issue: []

Expected result

Actual result

Steps to reproduce

Context

Your Environment

  • Version used:
  • Operating System and version:
  • Link to your fork:

`InvalidArgumentError` while training an image classification model

Bug description

InvalidArgumentError while training an image classification model

InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument:    Unknown image file format. One of JPEG, PNG, GIF, BMP required.
	 [[{{node decode_image/DecodeImage}}]]
	 [[StatefulPartitionedCall]]
	 [[IteratorGetNext]]
  (1) Cancelled:  Function was cancelled before it was started
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_1024160]

Function call stack:
train_function -> train_function -> train_function -> train_function

Expected result

Actual result

Steps to reproduce

Context

Your Environment

  • Version used:
  • Operating System and version:
  • Link to your fork:

Fix README

Here are some changes that I am proposing to the README to make it look better and according to the convention.

  • Change the banner image to 1280x640 px image.
  • Make the headings and subheadings better.
  • Add links to create an issue and contributing guide where they are mentioned in the README.
  • Change "How to use section" to "Usage" as it is the convention.

You can also use the banner image as the repo preview image.

I will take this issue and make a PR.

remove converter module

Bug description

converter module is not being used and is buggy.

Expected result

Actual result

Steps to reproduce

Context

Your Environment

  • Version used:
  • Operating System and version:
  • Link to your fork:

UI app for models

Is your feature request related to a problem?

Create app UI with Gradio or Streamlit for model predictions.

Describe the solution you'd like

Right now we have create_api function, there should be a create_app function that can create Gradio or Streamlit app automatically.

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.

confidence analyzer

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

plot confusion matrix

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

There should be a way to plot confusion matrix easily

Describe the solution you'd like

from chitra.plot import confusion_matrix
confusion_matrix(y_truth, y_pred)

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.

perf test models ๐Ÿ€

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

A module to benchmark Models based resources and speed ๐Ÿš„ ๐Ÿ€ .

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

text-generation api support?

NotImplementedError: TEXT-GENERATION is not implemented! Available types are -  ['IMAGE-CLASSIFICATION', 'OBJECT-DETECTION', 'TEXT-CLASSIFICATION', 'QUESTION-ANS']

why there is no support for text generation? would you consider adding it?

Add Issue and Feature Templates

Adding issue and feature templates are good practice for making things easier for the contributors and making sure that everything is managed properly.

ImportError: cannot import name 'show_batch' from 'chitra.dataloader'

ubuntu 20.04
anconda env
install local packages
$ pip install .
Installing collected packages: chitra
Attempting uninstall: chitra
Found existing installation: chitra 0.2.0a1
Uninstalling chitra-0.2.0a1:
Successfully uninstalled chitra-0.2.0a1
Successfully installed chitra-0.2.0a1

python demo.py
import numpy as np
import chitra
from chitra.dataloader import Clf, show_batch
import matplotlib.pyplot as plt

from chitra.dataloader import Clf, show_batch
ImportError: cannot import name 'show_batch' from 'chitra.dataloader'

chitra.serve template generation via cli

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

Lightweight packaging and imports

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

Right now DL libraries are tightly coupled and impact module import time. Need to refactor imports and make some libraries optional.

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

Video

First off, Apologies for opening an issue for this. I'm currently not active on Social Media but wanted a way to share this.

Second, Thanks so much for this amazing open source library. This is amazing work! Kudos to @aniketmaurya and the contributors.

Here's my small video contribution to spread the word - https://youtu.be/0RJfKJEXUDg

Once again, I'm sorry for raising an issue for this. please close this issue after you read the message.
Thanks!

`Chitra(url, cache=True)` not working properly

Bug description

Chitra(..., cache=True) caching is not working correctly.

URL_1 = 'https://one.com/image.jpg'
URL_2 = 'https://two.com/image.jpg'

In this case image is cached with the first URL only and subsequence call will return older image from cache.

Expected result

Calling Chitra(url1) and Chitra(url2) should return correct image.

resize image with bounding boxes

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

Right now there is no way to resize image along with the bounding boxes.

Describe the solution you'd like

from chitra.image import Chitra

label = 'Dog'
bbox = [ 70,  25, 190, 210]
image = Chitra(image_path, bboxes=bbox, labels=label)

# the resize function should resize image along with bounding box
image.resize((224, 224)

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.

Update documentation with new Chitra Version

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.

integrate autodocstrings

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

Automatically create documentation from docstrings

TF Serving GRPC client

Sending images to TF serving with REST API is slower than gRPC.

Create a gRPC client class that will take server and port and will create a connection. The client object can be reused for sending data multiple times.

Label Manager

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

Create a label manager for multilabel classification tasks.

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.
``

๐Ÿš€ Create a Logger with support for Console, File and MLFlow logging

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

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

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.