Git Product home page Git Product logo

hdf5imagemarker's Introduction

Decription

This utility is applicable to marking up any points of an image according to neural network creators requirements irrespective to count of these points.

With this utility you may get coordinates of any image points that are keys accordingly to your purposes and write down these image and coordinates into the dataset at the all your points have been marked up

How to install

git clone https://github.com/MostHappyCougar/HDF5ImageMarker.git

Or just download source code from last release

Requirements

This utility made and tested using following packages:

Package Version
torchvision 0.14.0+cu117
torch 1.13.0+cu117
h5py 3.7.0
matplotlib 3.5.3
numpy 1.23.1

How to use

  1. Create your input folder where the images for marking will be take from
    • This folder should be created upon the directory the img_marker.py is stored in
  2. Create subdirectory in this folder and put your image set into this subdirectory
  3. Set the name of input folder into the <source_folder> tag of config.xml file
  4. Create output folder upon directory the img_marker.py is stored in
  5. Set the name of output folder into the <output_folder> tag of config.xml file

Now you can use this util via running img_marker.py as regular python script

  • To mark up the key point just click to an image in required position
  • To cancel last point - press z. You may cancel all points for current image
  • When all points have been marked up press Enter to save

Detail configuring

You can also configure some parameters of marking via config.xml. Be aware changing any parameters when img_marker.py is still running is not prodlike scenario. You may change any parameter in config.xml only before img_marker.py is ran.

Parameters overview

  • img_w and img_h - the sizes that an each image will be resized to. img_w is image width, img_h is image height
  • source_folder - The folder that images for marking is store in
  • output_folder - the folder where the HDF5 file will be save
  • marks_count - count of poits that will be marked up
  • file_name - name of HDF5 file. Should be specitied without file extention
  • dataset_name name of dataset inside the HDF5 file

hdf5imagemarker's People

Contributors

mosthappycougar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

hdf5imagemarker's Issues

Feature: Marking system

Description

We need to add functional tha make possible to mark image and write down pair image-marks "On the Fly" at the "Enter" button pressed.
Also we need to add possibility to REVERT last mark (until the first one) at the "Z" button pressed.
Each mark should be reflected in the image at the marked up

Exceprions

When all possible marks for the image have been marked up and user tries to mark another one we need to rise exception "No available marks for this image"

Related Issues

Feature: Add possibility to adjust marks count

Description

To make more ability for using this service we need to add possibility toi adjust marks counts
Due to this service will be used for preparing datasets for neuro net training and validation, adjusting of marks count will take place via config.
The cause of this decition is USUALLY FIXED COUNT of output neurons

Requested parameter

  • Parameter Name: marks_counts
  • Data Type: uint16
  • Resctictions: This value should be greater than zero

EPIC: Add possibility to adjust count of marks and output file name, dataset name and open file mode

Description

To make more ability for functional we should to add feature that make possible to set required count of marks that will be marked up for the image

This value will be placed upon conf section of the config.xml

Also we should add posibility to adjust:

  • Output File Name
  • Dataset Name
  • Write mode

In case when EXISTING file opened and NO dataset introduced upon this file the dataset should be created. It is required to make more ability to create different datasets upon same file

Config architecture example:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<conf>
		<img_w>2</img_w>
		<img_h>2</img_h>
		<window_size_w>16</window_size_w>
		<window_size_h>8</window_size_h>
		<source_folder>source</source_folder>
		<output_folder>output</output_folder>
		<marks_counts>5</marks_counts>
		<output_file>
			<file_name>test_suite</file_name>
			<dataset_name>Test</dataset_name>
			<write_mode>a</write_mode>
		</output_file>
	</conf>
	
	<logs>
		<log_folder>logs</log_folder>
		<import_logs>0</import_logs>
	</logs>
</root>

Related Issues:

EPIC: Improve code readability and performance

At this moment there is a major issue with readability and performance. It may be cause of some bad experience of this utility using and enhancement.

The list of actual problems:

  1. A lot of crunches that make code very unreadable
  2. Due to crunches this code is not optimized so performance is less than possible
  3. There is no object-oriented code so it also reduce code readability
    1. Unoptimized images marking process
  4. Excessive issue information

So the main way to improve this utility quality is making code more object-oriented and delete useless features at least.

Feature: Add possibility to adjust hdf5 file and dataset names

Description

We need to have possibility to change output file name and dataset upon there at the marking start. This action should be take place via config and no possibility to change filename and dataset name on the fly

Requested parameters:

file_name

  • Data Type: string
  • Restrictions: Should be not empty, strarts with no space

dataset_name

  • Data Type: string
  • Restrictions: Should be not empty, strarts with no space

write_mode

  • Data Type: string
  • Restrictions: Should be only 'w' (write) or 'a' (apend)

This values shopuld be grouped in section output_file of conf section in xml config

Example:

<output_file>
	<file_name>test_suite</file_name>
	<dataset_name>Test</dataset_name>
	<write_mode>a</write_mode>
</output_file>

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.