Vignana-Jyothi / vnr-campus-navigator

GNU General Public License v3.0
0 stars 0 forks source link

conclude on the image labeling tools. #4

Open head-iie-vnr opened 3 months ago

head-iie-vnr commented 3 months ago

sudo apt-get update sudo apt-get install poppler-utils

pdftoppm -png ABC_1Floor.pdf output pdftoppm -jpeg ABC_1Floor.pdf output

head-iie-vnr commented 3 months ago

tried installing vott directly & using docker. Both were giving issues.

tried installating labelImg but it was crashing when I try to scroll on the image.

head-iie-vnr commented 3 months ago

Here are the steps to install and run VoTT using Docker:

Step 1: Install Docker

If Docker is not already installed on your system, you can install it using the following commands:

  1. Update your package list and install prerequisites:

    sudo apt update
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  2. Add Docker’s official GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  3. Add the Docker repository to APT sources:

    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  4. Update the package database with Docker packages:

    sudo apt update
  5. Install Docker:

    sudo apt install docker-ce
  6. Start and enable Docker service:

    sudo systemctl start docker
    sudo systemctl enable docker

Step 2: Pull the VoTT Docker Image

Using the cortexia/vott Docker Image

  1. Pull the cortexia/vott Docker Image:
docker pull cortexia/vott
  1. Run the cortexia/vott Docker Container:
docker run -d -p 3000:3000 cortexia/vott

Access VoTT

  1. Open your web browser and navigate to:
http://localhost:3000

You should see the VoTT interface, and you can start creating a new project and annotating your images.

Additional Commands

Notes

  1. Persistent Storage: If you want to ensure your annotations and projects persist across container restarts, you can map a local directory to a directory inside the container using Docker volumes.

    docker run -d -p 3000:3000 -v /path/to/local/directory:/data mcr.microsoft.com/vott
  2. Updating VoTT: To update VoTT, you will need to pull the latest Docker image and run a new container.

    docker pull mcr.microsoft.com/vott
    docker run -d -p 3000:3000 mcr.microsoft.com/vott

Alternative: Install and Run VoTT using npm

If using the cortexia/vott image doesn't work as expected, you can alternatively install and run VoTT using npm.

  1. Install Node.js and npm: If you don't have Node.js and npm installed, you can install them using the following commands:
sudo apt update
sudo apt install nodejs npm
  1. Install VoTT via npm:
npm install -g vott
  1. Run VoTT:
vott

Convert PDF to Images

Regardless of the method you choose for VoTT, you will need to convert your PDF to images. Use the pdftoppm command as described earlier:

sudo apt-get install poppler-utils
pdftoppm -png ABC_1Floor.pdf output

This will generate output-1.png, output-2.png, etc., for each page in the PDF.

Using VoTT

  1. Open VoTT:

    • Launch VoTT using the command vott from npm, or go to http://localhost:3000 if using Docker.
  2. Create a New Project:

    • Open VoTT and create a new project.
    • Import your converted images (e.g., output-1.png, output-2.png, etc.).
  3. Annotate Images:

    • Use the annotation tools to draw rectangular boxes around the rooms.
    • Add metadata such as room number, floor number, and type of room.
  4. Save and Export Annotations:

    • Save your project.
    • Export the annotations in the desired format (COCO, Pascal VOC, YOLO, etc.).

By following these steps, you should be able to annotate your floor plan images and save the core data and metadata using VoTT. If you encounter any further issues or have additional questions, feel free to ask for more assistance.

head-iie-vnr commented 3 months ago

Write script

https://github.com/Vignana-Jyothi/vnr-campus-navigator/blob/main/annotation_tool/image_annotate.py

To annotate. It generated json in the below format when saved [ { "coordinates": [ 638, 111, 868, 277 ], "room_number": "A-206", "room_type": "LAB", "floor_number": "1" } ](

head-iie-vnr commented 3 months ago

chatgpt is also able to generate the JSON well.