Code Monkey home page Code Monkey logo

coco-annotator-ng's Introduction

COCO Annotator next generation

This version of COCO Annotator is a strait port from JsBroks COCO Annotator official version to vue3.2+

Before going further, if you already use JsBroks COCO Annotator and want to switch to this version, you will have to change user password encryption methode in mongo database (Werkzeug 3 break change).
For this, you will have to install an old and compatible Werkzeug python library and use the change_password_hash_type.py python script:

pip install werkzeug==2.0.3
pip install pymongo
python change_password_hash_type.py

By default change_password_hash_type.py only change password hash type for the admin user.
Edit this file and run it again to migrate others users accounts.
You will have to know all users password to migrate all passwords.
You can then use any recent werkzeug version.

Features

Now we can talk about what this version will provide:

  • vue 3.2+ style code
  • upgraded python libraries versions
  • upgraded javascript packages
  • use Bootstrap5
  • use pinia instead of vuex
  • use vite instead of vue-cli
  • added segment anything tool (SAM-HQ) to help to segment objects (1 click to segment an object)
  • activate GPU (seem's this was not really activated even when using docker-compose.gpu.yml)
  • fixed some bugs and javascript errors
  • can use detectron2 models to help segment objects
  • moved IA to a dedicated container to make coco-annotator lighter when not using them
  • moved DEXTR from tensorflow to pytorch
  • add SAM (Segment Anything Model) support for 1 click object segmentation
  • maybe more ...

what features you will loose or bugs are introduced:

  • watchdog to detect new images has been disabled (this was freezing the application. This feature may be reactivated later)
  • pinch zoom has been removed (need to find a library to replace and use a tablet to test it)
  • objects id are not the new ones when switching to next or previous images (need to click on an object to get ids updated)
  • exported json annotations files seem's ok but are actually not fully tested
  • hope to not have more bugs and features removed...

Build docker images

There is actually no pre-built docker images.
You will have to build docker images by yourself.
Note that docker images are actually using around 15Gb disk space. Make sure to have at least 30Gb disk space to build all images.

Building docker images:

First build base images:

    bash ./build_base_image.sh

Then build compnents images depending of your needs.

Production images with no IA support:

docker compose -f ./docker-compose.build.yml build
docker compose -f ./docker-compose.yml up

Dev images with IA support:

docker compose -f ./docker-compose.dev.yml build
docker compose -f ./docker-compose.dev.yml up

Production images with IA support:

docker compose -f /docker-compose.gpu.yml build
docker compose -f /docker-compose.gpu.yml up  

FeaturesWikiGetting StartedIssuesLicense


COCO Annotator is a web-based image annotation tool designed for versatility and efficiently label images to create training data for image localization and object detection. It provides many distinct features including the ability to label an image segment (or part of a segment), track object instances, labeling objects with disconnected visible parts, efficiently storing and export annotations in the well-known COCO format. The annotation process is delivered through an intuitive and customizable interface and provides many tools for creating accurate datasets.


Join our growing discord community of ML practitioner


Image annotations using COCO Annotator

Checkout the video for a basic guide on installing and using COCO Annotator.


Note: This video is from v0.1.0 and many new features have been added.


If you enjoy my work please consider supporting me


Features

Several annotation tools are currently available, with most applications as a desktop installation. Once installed, users can manually define regions in an image and creating a textual description. Generally, objects can be marked by a bounding box, either directly, through a masking tool, or by marking points to define the containing area. COCO Annotator allows users to annotate images using free-form curves or polygons and provides many additional features were other annotations tool fall short.

  • Directly export to COCO format
  • Segmentation of objects
  • Ability to add key points
  • Useful API endpoints to analyze data
  • Import datasets already annotated in COCO format
  • Annotate disconnect objects as a single instance
  • Labeling image segments with any number of labels simultaneously
  • Allow custom metadata for each instance or object
  • Advanced selection tools such as, DEXTR, MaskRCNN and Magic Wand
  • Annotate images with semi-trained models
  • Generate datasets using google images
  • User authentication system
  • Auto Annotate using MaskRCNN, MaskFormer (thank's to rune-l work) or Detectron2 models
  • Auto Annotate using SAM (Facebook Segment Anything)

For examples and more information check out the wiki.

Vue3 porting attempt

  • Make source code work with Vue3 in Vue2 compatibility mode
  • Modify to Vuex4 style files using Vuex store
  • convert mixins to composable API and components
  • Fix eslint errors 
  • Remove JQuery library
  • find a library to replace vue-touch for pinching
  • Make source code work without Vue2 compatibility mode
  • Understand Keypoints and make them fully work
  • Restore all shortcuts
  • Fix undefined Category error when clicking on some annotations
  • Fix recursive warnings and make prod version work
  • understand why categories and annotations are not updated in some objects till we click on a category or an annotation after going to next or previous image. annotations id are not the right ones in this case.

At this state, source code tested only using docker-compose.dev.yml. Lot of eslint errors appears, but application is functionnal

Using SAM (Segment Anything) - Deprecated to SAM-HQ

This coco annotator version is a vue3 port from original jsbrok coco-annotator based on vue2. This version still has some bugs mainly introduced by vue3 new behaviour or vue3 conversion, so use it at your own risks. Most of libraries has been updated to more recent versions.

To use SAM you will need a Cuda capable graphic card (or modify sources to use CPU. Untested). First rebuild a new base image using the following command from build_base_image.sh:

docker build -f ./backend/Dockerfile . -t jsbroks/coco-annotator:python-env

Download SAM model :

cd models;bash sam_model.sh

Then rebuild/build coco-annotator images using docker-compose.dev.yml or docker-compose.gpu.yml files :

docker compose -f ./docker-compose.dev.yml build

You can then run coco-annotator:

docker compose -f ./docker-compose.dev.yml up

Now select or create a new annotation.
Select the new SAM button in the left pannel (under DEXTR button).
Click on the object you want to create mask.
A new mask should be created.

Using SAM-HQ (Segment Anything in High Quality)

SAM-HQ is a drop in place of SAM with more precision: https://github.com/SysCV/sam-hq

Simply download SAM-HQ model:

cd models;bash sam_hq_model.sh

Rebuild docker images :

docker compose -f ./docker-compose.dev.yml build

You can then run coco-annotator:

docker compose -f ./docker-compose.dev.yml up

SAM-HQ is now default, but you still can use original SAM modifying backend/webserver/Dockerfile
to comment line with sam-hq and uncomment line before installing segment-anything. # RUN pip install segment-anything RUN git clone https://github.com/SysCV/sam-hq.git && cd sam-hq && pip install -e .

And modify docker-compose.dev.yml:

- SAM_MODEL_FILE=/models/sam_vit_b_01ec64.pth # - SAM_MODEL_FILE=/models/sam_hq_vit_b.pth

Download SAM model (if not already done) rebuild docker images and restart coco-annotator using docker-compose.

Demo

Login Information
Username: admin
Password: password

https://annotator.justinbrooks.ca/

Backers

If you enjoy the development of coco-annotator or are looking for an enterprise annotation tool, consider checking out DataTorch.

https://datatorch.io · [email protected] · Next generation of coco-annotator

Built With

Thanks to all these wonderful libaries/frameworks:

Backend

  • Flask - Python web microframework
  • MongoDB - Cross-platform document-oriented database
  • MongoEngine - Python object data mapper for MongoDB

Frontend

  • Vue - JavaScript framework for building user interfaces
  • Axios - Promise based HTTP client
  • PaperJS - HTML canvas vector graphics library
  • Bootstrap - Frontend component library

License

MIT

Citation

  @MISC{cocoannotator,
    author = {Justin Brooks},
    title = {{COCO Annotator}},
    howpublished = "\url{https://github.com/jsbroks/coco-annotator/}",
    year = {2019},
  }

coco-annotator-ng's People

Contributors

sixk avatar

Stargazers

Max avatar Marlon avatar ShutongJIN avatar Vincent ARANZANA-CLIMENT avatar  avatar Erwin Qi avatar  avatar Jeffrey Hsu avatar  avatar Jan Viktor Apel avatar YuyaMiyata avatar sh avatar robbiewong avatar

Watchers

Jan Viktor Apel avatar  avatar  avatar

Forkers

jeffhsu3

coco-annotator-ng's Issues

Build image error.

Hi, I clone your repo and try to build image and run as described in README.md, error occured:

[workers 3/4] RUN apt-get update && apt-get install --no-install-recommends -y libsm6 libxrender1 libfontconfig1 libgl1 libglib2.0-0 && apt clean && rm -rf /var/lib/apt/lists/*:
0.695 Ign:1 http://deb.debian.org/debian stretch InRelease
0.809 Ign:2 http://deb.debian.org/debian stretch-updates InRelease
0.922 Ign:3 http://deb.debian.org/debian stretch Release
1.276 Ign:4 http://deb.debian.org/debian stretch-updates Release
1.714 Ign:5 http://security.debian.org/debian-security stretch/updates InRelease
1.723 Ign:6 http://deb.debian.org/debian stretch/main all Packages
1.837 Ign:7 http://deb.debian.org/debian stretch/main amd64 Packages
1.838 Ign:8 http://security.debian.org/debian-security stretch/updates Release
1.951 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
1.960 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
2.065 Ign:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
2.324 Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
2.426 Ign:6 http://deb.debian.org/debian stretch/main all Packages
2.465 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
2.543 Ign:7 http://deb.debian.org/debian stretch/main amd64 Packages
2.597 Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
2.660 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
2.731 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
2.776 Ign:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
2.847 Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
2.889 Ign:6 http://deb.debian.org/debian stretch/main all Packages
2.963 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
3.016 Ign:7 http://deb.debian.org/debian stretch/main amd64 Packages
3.129 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
3.332 Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
3.387 Ign:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
3.454 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
3.499 Ign:6 http://deb.debian.org/debian stretch/main all Packages
3.569 Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
3.690 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
3.755 Ign:7 http://deb.debian.org/debian stretch/main amd64 Packages
3.811 Err:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
3.811 404 Not Found
3.884 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
3.996 Ign:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
4.125 Ign:6 http://deb.debian.org/debian stretch/main all Packages
4.490 Ign:7 http://deb.debian.org/debian stretch/main amd64 Packages
4.602 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
4.714 Ign:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
4.827 Ign:6 http://deb.debian.org/debian stretch/main all Packages
5.253 Err:7 http://deb.debian.org/debian stretch/main amd64 Packages
5.253 404 Not Found
5.366 Ign:9 http://deb.debian.org/debian stretch-updates/main all Packages
5.477 Err:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
5.477 404 Not Found
5.487 Reading package lists...
5.523 W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
5.523 W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
5.523 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
5.523 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found
5.523 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found
5.523 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found
5.523 E: Some index files failed to download. They have been ignored, or old ones used instead.


failed to solve: process "/bin/sh -c apt-get update && apt-get install --no-install-recommends -y libsm6 libxrender1 libfontconfig1 libgl1 libglib2.0-0 && apt clean && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

How should I fixed it?

Environment:
OS version: CentOS 7, Docker version: 24.0.6

GPU Build process is broken

Hi, thank you for your contributions so far on this!

I am trying to build and test this and am noticing some things wrong with the GPU build.

First off, ./build_base_image.sh should be split out so that the commented lines are in another script, maybe build_gpu_image.sh containing these lines:

docker build . -t annotator_webclient --no-cache
docker build -f ./backend/workers/Dockerfile . -t annotator_workers --no-cache

Note how there is not _gpu suffix as this conflicts with the Dockerfile image names expected.

My real error is that when running docker compose -f ./docker-compose.gpu.yaml up (after running the previous scripts and build), I get this error with the annotator_ia container:

fatal: not a git repository (or any of the parent directories): .git
[2024-05-14 22:09:27 +0000] [7] [DEBUG] Current configuration:
  config: ia/gunicorn_config.py
  wsgi_app: None
  bind: ['0.0.0.0:6000']
  backlog: 2048
  workers: 1
  worker_class: eventlet
  threads: 1
  worker_connections: 1000
  max_requests: 0
  max_requests_jitter: 0
  timeout: 60
  graceful_timeout: 30
  keepalive: 2
  limit_request_line: 4094
  limit_request_fields: 100
  limit_request_field_size: 8190
  reload: True
  reload_engine: auto
  reload_extra_files: []
  spew: False
  check_config: False
  print_config: False
  preload_app: False
  sendfile: False
  reuse_port: False
  chdir: /workspace
  daemon: False
  raw_env: []
  pidfile: None
  worker_tmp_dir: None
  user: 0
  group: 0
  umask: 0
  initgroups: False
  tmp_upload_dir: None
  secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
  forwarded_allow_ips: ['127.0.0.1']
  accesslog: None
  disable_redirect_access_to_syslog: False
  access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
  errorlog: -
  loglevel: debug
  capture_output: False
  logger_class: gunicorn.glogging.Logger
  logconfig: None
  logconfig_dict: {}
  logconfig_json: None
  syslog_addr: udp://localhost:514
  syslog: False
  syslog_prefix: None
  syslog_facility: user
  enable_stdio_inheritance: False
  statsd_host: None
  dogstatsd_tags: 
  statsd_prefix: 
  proc_name: None
  default_proc_name: ia:app
  pythonpath: None
  paste: None
  on_starting: <function OnStarting.on_starting at 0x7a03575989d0>
  on_reload: <function OnReload.on_reload at 0x7a0357598af0>
  when_ready: <function WhenReady.when_ready at 0x7a0357598c10>
  pre_fork: <function Prefork.pre_fork at 0x7a0357598d30>
  post_fork: <function Postfork.post_fork at 0x7a0357598e50>
  post_worker_init: <function PostWorkerInit.post_worker_init at 0x7a0357598f70>
  worker_int: <function WorkerInt.worker_int at 0x7a0357599090>
  worker_abort: <function WorkerAbort.worker_abort at 0x7a03575991b0>
  pre_exec: <function PreExec.pre_exec at 0x7a03575992d0>
  pre_request: <function PreRequest.pre_request at 0x7a03575993f0>
  post_request: <function PostRequest.post_request at 0x7a0357599480>
  child_exit: <function ChildExit.child_exit at 0x7a03575995a0>
  worker_exit: <function WorkerExit.worker_exit at 0x7a03575996c0>
  nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7a03575997e0>
  on_exit: <function OnExit.on_exit at 0x7a0357599900>
  ssl_context: <function NewSSLContext.ssl_context at 0x7a0357599a20>
  proxy_protocol: False
  proxy_allow_ips: ['127.0.0.1']
  keyfile: None
  certfile: None
  ssl_version: 2
  cert_reqs: 0
  ca_certs: None
  suppress_ragged_eofs: True
  do_handshake_on_connect: False
  ciphers: None
  raw_paste_global_conf: []
  strip_header_spaces: False
[2024-05-14 22:09:27 +0000] [7] [INFO] Starting gunicorn 21.2.0
[2024-05-14 22:09:27 +0000] [7] [DEBUG] Arbiter booted
[2024-05-14 22:09:27 +0000] [7] [INFO] Listening at: http://0.0.0.0:6000 (7)
[2024-05-14 22:09:27 +0000] [7] [INFO] Using worker: eventlet
[2024-05-14 22:09:27 +0000] [9] [INFO] Booting worker with pid: 9
[2024-05-14 22:09:27 +0000] [7] [DEBUG] 1 workers
/workspace/sam-hq/segment_anything/modeling/tiny_vit_sam.py:662: UserWarning: Overwriting tiny_vit_5m_224 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/workspace/sam-hq/segment_anything/modeling/tiny_vit_sam.py:662: UserWarning: Overwriting tiny_vit_11m_224 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_11m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/workspace/sam-hq/segment_anything/modeling/tiny_vit_sam.py:662: UserWarning: Overwriting tiny_vit_21m_224 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/workspace/sam-hq/segment_anything/modeling/tiny_vit_sam.py:662: UserWarning: Overwriting tiny_vit_21m_384 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_384. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/workspace/sam-hq/segment_anything/modeling/tiny_vit_sam.py:662: UserWarning: Overwriting tiny_vit_21m_512 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
[2024-05-14 22:09:29 +0000] [9] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
    worker.init_process()
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/workers/geventlet.py", line 143, in init_process
    super().init_process()
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
zz info: vit_b /models/sam_hq_vit_b.pth
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/opt/conda/lib/python3.10/site-packages/gunicorn/util.py", line 371, in import_app
    mod = importlib.import_module(module)
  File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspace/ia/__init__.py", line 14, in <module>
    from .api import blueprint as api
  File "/workspace/ia/api/__init__.py", line 6, in <module>
    from .models import api as ns_models
  File "/workspace/ia/api/models.py", line 20, in <module>
    from ..util.sam import model as sam
  File "/workspace/ia/util/sam.py", line 49, in <module>
    model = SAM()
  File "/workspace/ia/util/sam.py", line 19, in __init__
    sam = sam_model_registry[SAM_MODEL_TYPE](checkpoint=SAM_MODEL_PATH)
  File "/workspace/sam-hq/segment_anything/build_sam.py", line 38, in build_sam_vit_b
    return _build_sam(
  File "/workspace/sam-hq/segment_anything/build_sam.py", line 162, in _build_sam
    state_dict = torch.load(f, map_location=device)
  File "/opt/conda/lib/python3.10/site-packages/torch/serialization.py", line 795, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/opt/conda/lib/python3.10/site-packages/torch/serialization.py", line 1002, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.
[2024-05-14 22:09:29 +0000] [9] [INFO] Worker exiting (pid: 9)
[2024-05-14 22:09:29 +0000] [7] [ERROR] Worker (pid:9) exited with code 3
[2024-05-14 22:09:29 +0000] [7] [ERROR] Shutting down: Master
[2024-05-14 22:09:29 +0000] [7] [ERROR] Reason: Worker failed to boot.

Any ideas?

COCO Export returns Undefined, Export doesn't include Mask Images

Hi again, just noting a few things about the COCO export process.

The first issue is a bug: when I press the "Download COCO" button from the dataset dropdown, I get a json file which simply contains the word "undefined". If instead I go to the dataset page and say "Export COCO" then go to the "Exports" tab though, the exported json works fine.

The next thing is that there are no annotated images exported. (this may be a feature request, not sure)
I can click on the three dots for an image in the dataset and click "Download Image and COCO", but this option only downloads the unlabelled image. Is there a way we can download the annotated images (either the individual masks or the composite image)?
It would be great if the export could download the normal image, the annotated image, for each image in a dataset and then the annotations json for that dataset. I am looking into this portion but am still unfamiliar myself.

Admin Account Script Bugs

Hi again, thanks so much for the responsiveness so far.
Currently am running into an error with creating any user accounts:

annotator_webclient  | [2024-05-21 22:49:20 +0000] [9] [ERROR] Exception on /api/admin/user/ [POST]
annotator_webclient  | Traceback (most recent call last):
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
annotator_webclient  |     rv = self.dispatch_request()
annotator_webclient  |          ^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
annotator_webclient  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/api.py", line 402, in wrapper
annotator_webclient  |     resp = resource(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/views.py", line 110, in view
annotator_webclient  |     return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/resource.py", line 41, in dispatch_request
annotator_webclient  |     resp = meth(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view
annotator_webclient  |     return current_app.ensure_sync(func)(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/workspace/webserver/api/admin.py", line 75, in post
annotator_webclient  |     user.password = generate_password_hash(args.get('password'), method='sha256')
annotator_webclient  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 101, in generate_password_hash
annotator_webclient  |     h, actual_method = _hash_internal(method, salt, password)
annotator_webclient  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 66, in _hash_internal
annotator_webclient  |     raise ValueError(f"Invalid hash method '{method}'.")
annotator_webclient  | ValueError: Invalid hash method 'sha256'.
annotator_webclient  | [2024-05-21 22:49:30 +0000] [9] [DEBUG] POST /api/admin/user/
annotator_webclient  | [2024-05-21 22:49:30 +0000] [9] [ERROR] Exception on /api/admin/user/ [POST]
annotator_webclient  | Traceback (most recent call last):
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
annotator_webclient  |     rv = self.dispatch_request()
annotator_webclient  |          ^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
annotator_webclient  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/api.py", line 402, in wrapper
annotator_webclient  |     resp = resource(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/views.py", line 110, in view
annotator_webclient  |     return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/resource.py", line 41, in dispatch_request
annotator_webclient  |     resp = meth(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view
annotator_webclient  |     return current_app.ensure_sync(func)(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/workspace/webserver/api/admin.py", line 75, in post
annotator_webclient  |     user.password = generate_password_hash(args.get('password'), method='sha256')
annotator_webclient  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 101, in generate_password_hash
annotator_webclient  |     h, actual_method = _hash_internal(method, salt, password)
annotator_webclient  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 66, in _hash_internal
annotator_webclient  |     raise ValueError(f"Invalid hash method '{method}'.")
annotator_webclient  | ValueError: Invalid hash method 'sha256'.
annotator_webclient  | [2024-05-21 22:49:33 +0000] [9] [DEBUG] POST /api/admin/user/
annotator_webclient  | [2024-05-21 22:49:33 +0000] [9] [ERROR] Exception on /api/admin/user/ [POST]
annotator_webclient  | Traceback (most recent call last):
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
annotator_webclient  |     rv = self.dispatch_request()
annotator_webclient  |          ^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
annotator_webclient  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/api.py", line 402, in wrapper
annotator_webclient  |     resp = resource(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask/views.py", line 110, in view
annotator_webclient  |     return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_restx/resource.py", line 41, in dispatch_request
annotator_webclient  |     resp = meth(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view
annotator_webclient  |     return current_app.ensure_sync(func)(*args, **kwargs)
annotator_webclient  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/workspace/webserver/api/admin.py", line 75, in post
annotator_webclient  |     user.password = generate_password_hash(args.get('password'), method='sha256')
annotator_webclient  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 101, in generate_password_hash
annotator_webclient  |     h, actual_method = _hash_internal(method, salt, password)
annotator_webclient  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
annotator_webclient  |   File "/usr/local/lib/python3.11/site-packages/werkzeug/security.py", line 66, in _hash_internal
annotator_webclient  |     raise ValueError(f"Invalid hash method '{method}'.")
annotator_webclient  | ValueError: Invalid hash method 'sha256'.

When I try to do the workaround listed in the readme I get the following error:
$python change_password_hash_type.py

{'name': 'Remove Current Polygon', 'keys': ['escape']}, {'name': 'Increase Radius', 'keys': ['[']}, {'name': 'Decrease Radius', 'keys': [']']}, {'name': 'Increase Radius', 'keys': ['[']}, {'name': 'Decrease Radius', 'keys': [']']}, {'name': 'Subtract Selection', 'keys': ['shift', 'click']}]}}, 'permissions': [], 'last_seen': datetime.datetime(2024, 5, 21, 22, 50, 20, 299000)}
old_hash: None
Traceback (most recent call last):
  File "/home/chance/Repos/coco-annotator-ng/change_password_hash_type.py", line 67, in <module>
    new_hash = verify_password_and_generate_hash(password, old_hash)
  File "/home/chance/Repos/coco-annotator-ng/change_password_hash_type.py", line 23, in verify_password_and_generate_hash
    if check_password_hash(hashed_password, password):
  File "/home/chance/.pyenv/versions/3.10.4/lib/python3.10/site-packages/werkzeug/security.py", line 215, in check_password_hash
    if pwhash.count("$") < 2:
AttributeError: 'NoneType' object has no attribute 'count'

Bounding Box annotation

Selecting BBox Tool creates additional annotations on top of the already existing empty annotation

Steps to reproduce:
1, open an image to annotate
2, select + icon for a category
-> "Select Tool" activated by default
-> Category shows an Empty annotation
3. select BBox Tool

Result:
Additionally to the empty annotation, a new annotation with the BBox has been created. The empty annotation needs to be removed manually

Expected Result
Switching the Tool should apply to the empty yet created annotation like in original version of coco-annotator

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.