Skip to content

Conversation

@Vismayak
Copy link
Contributor

@Vismayak Vismayak commented Jun 26, 2024

**The widget is working but for proper testing it would be good to have a sample extractor for annotating images in pyclowder, I finished the rough draft of it already **

Aim

The aim of this widget is to annotate images using user points to create a polygon around an object, the code could also be reused for other image based tasks like image prompting

How to test

In the front end directory run npm install as we have a couple of new libraries

Run an extractor, locally as in to do the necessary modifications. The extractor should be used on image files. For ease, I created a sample extractor in the pyclowder repo (branch is called sample-image-annotation-extractor). Running the extractor, is the best way to test the widget.

  1. Add another parameter in extractor-info.json file,
"parameters": {
    "schema": {
      "Annotations": {
        "type": "string",
        "title": "Annotate image",
        "description": "Annotate image",
        "format": "ImageAnnotator"
      }
    }
  }
  1. When you open the extractor, you can see a button that opens a modal
    image
    image

Clicking on the image should create points that form a polygon around the desired object, add a name to save annotation.

PS I also made some changes regarding the FileSelector Component to make the naming consistent

@Vismayak Vismayak requested a review from longshuicy as a code owner June 26, 2024 19:39
@Vismayak Vismayak linked an issue Jun 26, 2024 that may be closed by this pull request
@Vismayak Vismayak changed the title 1124 annotate image widget [WIP] Annotate image widget Jun 26, 2024
@Vismayak Vismayak removed the request for review from longshuicy June 26, 2024 19:48
@longshuicy
Copy link
Member

Is this ready to be reviewed? If so could you remove the [WIP]? If not, could you switch it back to draft PR? Thanks!

@Vismayak Vismayak changed the title [WIP] Annotate image widget Annotate image widget Jul 9, 2024
@Vismayak Vismayak requested review from ddey2 and longshuicy July 9, 2024 18:21
@Vismayak
Copy link
Contributor Author

Vismayak commented Jul 9, 2024

@longshuicy how do you resolve conflicts with package-lock.json, I tried deleting it and npm i but it is not helping, is there a specific way to add new packages? I had to install d3 library to make the widget

@Vismayak Vismayak requested review from lmarini and tcnichol July 10, 2024 21:08
@tcnichol
Copy link
Contributor

I'm getting an error message in this extractor when I run it on an image.

024-07-10 16:23:25,157 [Thread-4       ] INFO    : pyclowder.connectors - [668efb5251ab8a71801b8def] : StatusMessage.start: Started processing.
2024-07-10 16:23:25,158 [Thread-4       ] DEBUG   : pyclowder.extractors - default check message : {'host': 'http://localhost:8000', 'secretKey': 'eyJ1c2VyIjoiYUBhLmNvbSIsImtleSI6IkUyN1dUSWdERXIycmpxSzJPNjFfSHcifQ.sUuiutsnuAlNhRRg6dpyneh214Q', 'retry_count': 0, 'resource_type': 'file', 'flags': '', 'filename': '20230614_202933.jpg', 'fileSize': 938600, 'id': '668efb5251ab8a71801b8def', 'datasetId': '6688bb65387012ac7f7fa572', 'job_id': '668efbcd51ab8a71801b8dff', 'parameters': {}, 'routing_key': 'ncsa.image_annotator'}
2024-07-10 16:23:25,194 [Thread-4       ] INFO    : pyclowder.connectors - [668efb5251ab8a71801b8def] : StatusMessage.processing: Downloading file.
2024-07-10 16:23:25,274 [Thread-4       ] INFO    : root - Received parameters
2024-07-10 16:23:25,274 [Thread-4       ] INFO    : pyclowder.connectors - [668efb5251ab8a71801b8def] : StatusMessage.done: Done processing.
Failed to load parameters, it's not compatible with json.loads().
Error:the JSON object must be str, bytes or bytearray, not dict

@tcnichol
Copy link
Contributor

Errors fixed by cleaning old volumes.

@tcnichol
Copy link
Contributor

Here is the metadata I see after running it on an image.
annotation_metadata

@tcnichol
Copy link
Contributor

If you can fix the merge conflicts I think this one is good to go.

@Vismayak Vismayak requested a review from max-zilla as a code owner July 22, 2024 18:05
@Vismayak Vismayak self-assigned this Aug 1, 2024
@Vismayak Vismayak added this to the v2.0-beta-3 milestone Aug 1, 2024
@Vismayak Vismayak changed the base branch from main to release/v2.0-beta-3 August 6, 2024 15:50
@Vismayak Vismayak changed the base branch from release/v2.0-beta-3 to main August 6, 2024 15:50
@Vismayak Vismayak marked this pull request as draft August 21, 2024 19:52
@Vismayak Vismayak marked this pull request as ready for review August 22, 2024 18:35
@lmarini lmarini merged commit 11a4860 into main Aug 28, 2024
@lmarini lmarini deleted the 1124-annotate-image-widget branch August 28, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate image widget

5 participants