Coder Social home page Coder Social logo

britefury / django-labeller Goto Github PK

View Code? Open in Web Editor NEW
137.0 137.0 40.0 11.59 MB

An image labelling tool for creating segmentation data sets, for Django and Flask.

License: MIT License

Jupyter Notebook 70.15% Python 11.57% CSS 0.90% JavaScript 6.93% TypeScript 8.05% HTML 2.07% Jinja 0.33%

django-labeller's People

Contributors

britefury avatar gfrenchuea avatar ngeldvis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-labeller's Issues

When are the ts files converted to js?

I made a change to some js, but setup.py install is not overwriting them [my changes].
I'm wondering if I need to make my changes to the .ts for the changes to be permanent.

TypeError: Labels() got an unexpected keyword argument 'complete'

When running populate.py, get an error

"TypeError: Labels() got an unexpected keyword argument 'complete'".

I think the problem is in line 37 of populate.py:

labels_model = lt_models.Labels(
                    labels_json_str = json.dumps(labels), 
                    complete = complete,
                    creation_date = datetime.date.today())

In image_labelling_tool.models, the Labels() class does not have a positional arg "complete". I suspect you are trying to refer to "completed_tasks".

When I changed the problematic line in populate.py to try and fix the issue:

labels_model = lt_models.Labels(
                    labels_json_str = json.dumps(labels), 
                    completed_tasks = complete,
                    creation_date = datetime.date.today())

I get another Django error

TypeError: Direct assignment to the forward side of a many-to-many set is prohibited.

I'm not familiar with Django so was not able to fix that problem and got stuck here.

[Django] Got a ' 404 not found ' when i tried to get data of labels.

##from settings.py
LABELLING_TOOL_EXTERNAL_LABEL_API = True
LABELLING_TOOL_EXTERNAL_LABEL_API_URL = 'http://127.0.0.1:8000/get_labels/'

##from cmd
Not Found: /get_labels/
[05/Oct/2022 14:57:20] "POST /get_labels/ HTTP/1.1" 404 3638
[05/Oct/2022 14:57:20] "GET /get_api_labels/3 HTTP/1.1" 200 7
[05/Oct/2022 14:57:20] "GET /labelling_tool_api?labels_for_image_id=3 HTTP/1.1" 200 458
[05/Oct/2022 14:57:50] "GET /labelling_tool_api?labels_for_image_id=4 HTTP/1.1" 200 149
[05/Oct/2022 14:57:50] "GET /media/070417392948024_-_.jpg HTTP/1.1" 200 256602

I had a button notes "Get Annotations" above 127.0.0.1:8000/tool. And when I clicked it, nothing happened and I got a 404 in cmd.
What should I do to get data of labels in json file?

Is it possible to change the thickness of the brush?

Nice tool for labeling!
I have images where I want exactly to hit the corners with the brush.
For that purpose I need to change the thickness.
I was using the Qt desktop application.
Unfortunately I haven't found by myself, where to change it..

can't save and load label

I run labeller in conda with flask application.
How can I load labels in different directory? Not in images directory.
For example:
data/
|--- images/
|---------1.jpg, 2.jpg ....
|--- jsons/
|---------1__labels.json, 2__labels.json...

I want to separate json files from images directory like above.
Then load json files from jsons/ to modify my label.
Thanks.

Shortcut (keys) in flask

I'm trying to find if there are any already in here, but what do you think if some shortcuts were added? (When moving between images, some keys for the next action you want to take could save a lot of time). In my case, for example, I'm doing poly lines each image, (although I'd probably assign it to something on the left of the kb).
(Sorry, I have no experience with flask so I'm a bit lost in this code).

How can I add a button

Great tool!
I want to add a button to perform inference on another model (parallel to dextr) to compare the generated mask.
How can I do this? I know how to perform the inference, but don't know how to add a button on this template thing.
This model is a simple Unet, so I only need to pass the full image, without any point selection.
Sorry, I am pretty new to front-end. I want to do this on the flask version.
I tried modifying the labeller_app.html file adding:

    <button class="btn btn-sm btn-primary w-25 mb-1" type="button" id="unet_button" data-toggle="tooltip"
        data-placement="top" title="Unet labelling algo">Unet</button>

but I don't know what I would need to do on the flask app to recover the click form this button and implement my custom callback.

Output Format?

is the json output in a specific format? I'm looking for COCO format

DockerFile

Do you have a dockerfile for this repo?
I can try to make one.
Thanks

About image format and "memorized" images

Hello!

I think that this tool is very useful, but I would like to see in the README some info about the image format it recognizes. I tried using .jpeg and it didn't recognize them, but, when I changed to .jpg, it did. So know it beforehand might help new users.

Also, I have been choosing different folders with images until I targeted the .jpeg problem and, now, if there are 6 photos in the folder I am opening, the program chooses that those 6 photos are not the ones in the folder but part of the photos I chose in older selections. If the number of photos in the current folder is bigger than the number of different photos seen before, then, after showing older photos, it starts showing the new ones. Is there any way to restart this "memory" of older photos?

Thank you very much

Error 500 with DEXTR

Hi,

Your tool seems really useful but I have a problem when trying to using DEXTR.

I followed your installation guide and installed everything needed in a virtual environment (venv_django).

When I run the following code, it says everything is well installed:
pip install django-labeller[django]
pip install django-labeller[dextr]

However, when I launch either the Flask app or the Django app, everything works except DEXTR. I can indicate the four points when clicking on AutoP, but the box is never converted to a bounding polygon, even for the testing images as in your animated GIF.

I get the following error message in my terminal:

127.0.0.1 - - [03/Jan/2023 20:53:45] "POST /labeller/dextr HTTP/1.1" 500 - Traceback (most recent call last): File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 2548, in __call__ return self.wsgi_app(environ, start_response) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 2528, in wsgi_app response = self.handle_exception(e) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/Flask-2.2.2-py3.8.egg/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/django_labeller-0.3.2-py3.8.egg/image_labelling_tool/flask_labeller.py", line 176, in dextr regions_js = apply_dextr_js(image, dextr_points) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/django_labeller-0.3.2-py3.8.egg/image_labelling_tool/flask_labeller.py", line 63, in apply_dextr_js mask = dextr_fn(image_for_dextr, dextr_points) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/django_labeller-0.3.2-py3.8.egg/image_labelling_tool/flask_labeller.py", line 415, in <lambda> dextr_fn = lambda image, points: dextr_model.predict([image], points[None, :, :])[0] >= 0.5 File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/dextr/model.py", line 119, in predict pred_logits = self.net(input)['out'] File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/dextr/architectures/resunet.py", line 101, in forward x = self.decoder3(x, r16) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/dextr/architectures/resunet.py", line 53, in forward x_up = self.up(x_in) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/torch/nn/modules/upsampling.py", line 157, in forward recompute_scale_factor=self.recompute_scale_factor) File "/home/eliotruiz/venv_django/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1269, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

Thanks in advance for helping me solving this issue so I can use your tool for my researches.

Best, Eliot

Adding new image modalities

I am trying to integrate support for different image modalities (like DICOM). I overloaded the image loading functions in image_labelling_tool/labelled_image.py, and the images are being read fine and their size passed correctly to the flask labeller. However, when rendering the image from the img_url, the flask labeller does not consider the PIL image that was read by labelled_image, and instead tries to read/render directly from the file path and fails. Any suggestions on how to fix this?

[Question] How to add support for boxes with multiple labels

Hello,

Thank you for the great tool.

Any indication on where to start if I want to add support for boxes with multiple labels please ? I'm using specifically the django version of the tool.

I have a specific usecase wher I need to tag a box with mutiple labels when applicable and I can't create labels that are a union of other labels as the list grow exponentialy in this case.

I suppose, in this case, I have no proctical idea on how to handle colors when a box is tagged with multiple labels so I guess I need not to rely on the colors to know that I tagged correctly the element in the image and probably won't be using them either.

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.