Skip to content

smupilab/Pi-Labeler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi: Labeler

PiLab Labeler is an interactive annotation tool for labeling and saving masked images. It supports image zooming, panning, and brush-based drawing.

Features

  • Draw on Images: Annotate images with a brush tool.
  • Zoom & Pan: Mouse wheel to zoom, right-click to pan.
  • Save Annotations: Save masked images and original images with annotations.
  • Undo Support: Remove previous strokes.
  • Logging System: Keeps track of all actions in a log file.
  • Save Multiple Versions: Saves Mask, Masked on denoised, and Masked on original images.

Installation

Ensure you have Python 3 and required dependencies installed.

pip install -r requirements.txt

Usage

  1. Prepare Files and Folders

    • Place the pi_labeler.py file and the original and denoised folders in the same directory.

    • Add matching image files to the original and denoised folders.

  2. Run the Program

Run the following command to start the program:

python pi_labeler.py
  1. Drawing Annotations

    • Use the mouse to draw on the denoised image.

    • Adjust brush size and use zoom/pan features for better annotation control.

  2. Save Annotations

    • Press s to save the current annotated image.

    • The saved files will be stored in the following folders:

     •	mask/: The mask image with annotations.
    
     •	masked/: The annotated version of the denoised image.
    
     •	masked_original/: The annotated version of the original image.
    
  3. Navigate Between Images

    • Press n or > to move to the next image.

    • Press p or < to move to the previous image.

  4. Exit the Program

    • Press q to quit the program.

    • When exiting, a session end log will be automatically recorded.

Keyboard Shortcuts

Shortcut Action
p / < Previous image
n / > Next image
s Save current image
u Undo last stroke
i Zoom in
o Zoom out
+ / = Increase brush size
- / _ Decrease brush size
q Quit application

Mouse Actions

Mouse Action Description
Left-click & Drag Draw on the image
Mouse Wheel Zoom in/out
Right-click & Drag Pan the image

Logging

The application generates a log file (Labeler_YYYYMMDD_HHMMSS.log) to keep track of user actions. Logs include:

  • Session Start/End Times
  • Image Changes
  • Drawing Actions (strokes, brush sizes, etc.)
  • Undo Actions
  • Zoom & Pan Actions
  • Save Events

Pi: Labeler (한국어)

PiLab Labeler는 이미지에 마스킹 주석을 추가하고 저장할 수 있는 도구입니다. 확대/축소, 패닝, 브러시 기반 드로잉 기능을 지원합니다.

주요 기능

  • 이미지 위에 그리기: 브러시 도구를 이용해 주석 추가
  • 확대 및 패닝: 마우스 휠로 확대/축소, 우클릭으로 패닝
  • 주석 저장: 마스킹된 이미지와 원본 이미지 저장
  • 실행 취소 (Undo) 지원: 이전 획 제거 가능
  • 로그 시스템: 모든 작업을 기록하여 추적 가능
  • 다양한 버전 저장: Mask, Masked on denoised, Masked on original 저장

설치 방법

Python 3 및 필요한 라이브러리를 설치해야 합니다.

pip install -r requirements.txt

실행 방법

  1. 파일 및 폴더 준비

    • pi_labeler.py 파일과 original, denoised 두 개의 폴더를 같은 디렉터리 내에 위치시킵니다.

    • original 폴더와 denoised 폴더에 매칭되는 이미지 파일을 넣습니다.

  2. 프로그램 실행 아래 명령어를 실행하여 프로그램을 시작합니다.

python pi_labeler.py
  1. 드로잉 작업

     •   	denoised 이미지 위에 마우스를 이용해 드로잉을 진행합니다.
    
     •   	브러시 크기를 조절할 수 있으며, 확대/축소 및 패닝 기능을 활용할 수 있습니다.
    
  2. 주석 저장

    • s키를 눌러 작업한 이미지를 저장합니다.

    • 저장된 파일들은 다음과 같은 폴더에 저장됩니다.

     •	mask/: 주석이 적용된 마스크 이미지
     •	masked/: denoised 이미지에 주석이 적용된 버전
     •	masked_original/: original 이미지에 동일한 주석이 적용된 버전
    
  3. 다음 이미지로 이동

    • n 또는 > 키를 눌러 다음 이미지로 이동

    • p 또는 < 키를 눌러 이전 이미지로 이동

  4. 작업 완료후 종료

     • 	q 키를 눌러 프로그램을 종료하면 세션 종료 로그가 기록됩니다.
    

단축키

단축키 기능
p / < 이전 이미지
n / > 다음 이미지
s 현재 이미지 저장
u 마지막 획 실행 취소
i 확대
o 축소
+ / = 브러시 크기 증가
- / _ 브러시 크기 감소
q 프로그램 종료

마우스 동작

마우스 동작 설명
좌클릭 후 드래그 이미지 위에 그리기
마우스 휠 확대/축소
우클릭 후 드래그 이미지 패닝

로그 기록

프로그램 실행 시 Labeler_YYYYMMDD_HHMMSS.log 형식의 로그 파일이 생성되며, 다음과 같은 정보가 저장됩니다:

  • 세션 시작 및 종료 시간
  • 이미지 변경 내역
  • 드로잉 작업 (획 개수, 브러시 크기 등)
  • 실행 취소 작업
  • 확대 및 패닝 동작
  • 저장 이벤트

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages