Giter VIP home page Giter VIP logo

semi_labelling's Introduction

Semi-Auto Labelling Tool

Introduction

We developed a semi-auto labelling tool that automatically labels images for a single class using a pretrained model.

Important Features

  1. The tool currently supports the YOLOv5 model as an input model in the form of a .pt weight file. We plan to add support for more models in the future.
  2. Presently, only classification for one class is supported, but future versions will include support for multiple classes.
  3. The output format is YOLO Darknet, though future versions may support other output formats as well.

Installation

  1. Open a terminal (PowerShell or any other) and navigate to the repository path.

  2. Create a new environment using Conda or any environment manager (optional but recommended).

  3. If using pip, run the following command:

    pip install -r requirements.txt

    If using Conda, create a new environment with the required packages using:

    conda env create -f environments.yml
  4. Rename your model weights file (in .pt extension) to model.pt and place it in the model folder of the repository. (The default model included is for bees classification).

  5. Input your images into the input folder of the repository.

  6. Put the class name in class_list.txt. (Important!)

  7. Run the following command in the terminal:

    python run.py

    Optional Arguments:

    • -s, --image_size: Set the image size (single integer, default is 640).
    • -c, --conf_thres: Set the confidence threshold (default is 0.35).
    • -a, --auto_annot: Choose whether to run the auto annotator or not (Takes 'yes' or 'no', default is 'no').

    Example with optional arguments:

    python run.py -s 800 -c 0.4 -a yes
    
  8. An interactive window will open as shown below:

    Example Image

  9. Perform the labeling operations using the following keybindings:

    • Right-click mouse: Remove a label
    • Left-click: Draw a new label
    • Q: Quit
    • E: Reveal edges
    • W/S: Navigate classes
    • A/D: Navigate images
  10. After quitting, the labeled output will be available in YOLO Darknet format in the output/Yolo_darknet folder.

  11. To clean up the output, you can run the following command (Make sure to save the output elsewhere before running this command!):

    python clean_up.py

Docker Image

Link: scholar2001/semi_labelling

Running on Docker Desktop for Windows

  1. Pull the Image:

    • Pull the Docker image to your local system using the following command:

      docker pull scholar2001/semi_labelling:latest
  2. Install VcXsrv Windows X Server:

    • Before running the image, install VcXsrv Windows X Server from here. This X Server allows us to share an X11-session on a Windows host, enabling GUI support in Docker Containers on Windows.
  3. Run the Image:

    • Execute the command below to run the image, mapping input and output folders, and setting the DISPLAY environment variable:

      docker run -it -v path/to/image/input/folder:/app/input -v path/to/output/folder:/app/output -e DISPLAY=host.docker.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix scholar2001/semi_labelling:latest

    Replace path/to/image/input/folder and path/to/output/folder with the respective paths on your local system.

Running on Other Operating Systems

To use the Semi_Labelling tool on other operating systems, you need to forward the X11-Session to display the GUI.

Kindly refer to the documentation or instructions for your specific operating system on how to forward the X11-Session. This will enable you to run the tool with a GUI interface.

For further details and usage instructions, visit the Docker Hub repository: scholar2001/semi_labelling

Note: The instructions provided here assume you have Docker installed and properly configured on your system. Ensure that you have the required permissions and access to the input and output folders on your local system.

Credits

The code for run.py (which includes the GUI interface of the labeller) is based on this repository by Cartucho: https://github.com/Cartucho/OpenLabeling/blob/master/main/main.py

semi_labelling's People

Contributors

scholar-2001 avatar

Watchers

 avatar

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.