jsbroks / coco-annotator

:pencil2: Web-based image segmentation tool for object detection, localization, and keypoints
MIT License
2.12k stars 463 forks source link

Can't get maskRcnn to work #433

Open Marwen-Bhj opened 4 years ago

Marwen-Bhj commented 4 years ago

Runing the production build. I edit the docker-compose.yml as follows ;

- MASK_RCNN_FILE=/models/mask_rcnn_coco.h5 - MASK_RCNN_CLASSES=person,motorcycle

then within the coco-annotator folder, I ran :

sudo docker-compore up

I navigate to localhost:5000, create my dataset with the 'person' and 'motorcycle' categories, click on the images, I type the url of the model as mentionned in https://github.com/jsbroks/coco-annotator/issues/176, click on the cloud icon but nothing happens. no detection,nor masking. Isn't the tool supposed to be detecting the person and motorcycle for me and label them ?

annotator_webclient | [2020-11-08 23:38:08 +0000] [11] [DEBUG] POST /api/annotation/
annotator_webclient | [2020-11-08 23:38:08 +0000] [11] [INFO] marwen_bhj has created an annotation for image 6 with None
annotator_webclient | [2020-11-08 23:38:08 +0000] [11] [INFO] marwen_bhj has created an annotation for image 6
annotator_webclient | [2020-11-08 23:38:10 +0000] [11] [DEBUG] POST /api/model/maskrcnn
geminixiang commented 3 years ago

Runing the production build. I edit the docker-compose.yml as follows ;

- MASK_RCNN_FILE=/models/mask_rcnn_coco.h5 - MASK_RCNN_CLASSES=person,motorcycle

My method is edit MASK_RCNN_CLASSES = FULL-COCO-CLASS in your docker-compose.yml, and add some categories which you want in Datasets Page (ex. person, motorcycle).

raghavgurbaxani commented 3 years ago

@f416720001 @Marwen-Bhj were you able to solve the issue ? I am facing the same problem . Mask RCNN doesnt work for me

geminixiang commented 3 years ago

@raghavgurbaxani

OK, 6 steps needs check~

  1. Have you download model file? if not, then cd coco-annotator/models bash mask_coco_model.sh You would got a mask_rcnn_coco.h5 file in coco-annotator/models.
  2. your docker-compose.yml need to set. (see my setting below)
  3. go to page 'categories', and add 'YOU WANT TO DETECT CATEGORIES OF COCO' (likes stop sign, person...)
  4. go to page 'Datasets' -> edit dataset -> Default Categories -> Add a category (choose you add) -> Save
  5. go to page 'annotate', click left side 'image setting', edit Annotate API /api/model/maskrcnn
  6. docker-compose down -> docker-compose up -> MaskRCNN is on
version: "3"
volumes:
  mongodb_data:
    external: false

networks:
  cocoannotator:
    external: false

services:
  webserver:
    image: jsbroks/coco-annotator:webserver-latest
    container_name: annotator_webclient
    restart: always
    ports:
      - "5000:5000"
    environment:
      - TZ=Asia/Taipei
      - SECRET_KEY=RandomSecretKeyHere
      - FILE_WATCHER=true
      - MASK_RCNN_FILE=/models/mask_rcnn_coco.h5
      - MASK_RCNN_CLASSES=
        BG,person,bicycle,car,motorcycle,airplane,
        bus,train,truck,boat,traffic light,
        fire hydrant,stop sign,parking meter,bench,bird,
        cat,dog,horse,sheep,cow,elephant,bear,
        zebra,giraffe,backpack,umbrella,handbag,tie,
        suitcase,frisbee,skis,snowboard,sports ball,
        kite,baseball bat,baseball glove,skateboard,
        surfboard,tennis racket,bottle,wine glass,cup,
        fork,knife,spoon,bowl,banana,apple,
        sandwich,orange,broccoli,carrot,hot dog,pizza,
        donut,cake,chair,couch,potted plant,bed,
        dining table,toilet,tv,laptop,mouse,remote,
        keyboard,cell phone,microwave,oven,toaster,
        sink,refrigerator,book,clock,vase,scissors,
        teddy bear,hair drier,toothbrush
    volumes:
      - "./datasets:/datasets"
      - "./models:/models"
    depends_on:
      - database
      - workers
    networks:
      - cocoannotator
  workers:
    container_name: annotator_workers
    image: jsbroks/coco-annotator:workers-latest
    volumes:
      - "./datasets:/datasets"
    depends_on:
      - messageq
      - database
    networks:
      - cocoannotator
  messageq:
    image: rabbitmq:3
    container_name: annotator_message_q
    environment:
      - TZ=Asia/Taipei
      - RABBITMQ_DEFAULT_USER=user
      - RABBITMQ_DEFAULT_PASS=password
    networks:
      - cocoannotator
  database:
    image: mongo:4.0
    container_name: annotator_mongodb
    restart: always
    ports:
      - "27017:27017"
    environment:
      - TZ=Asia/Taipei
      - MONGO_DATA_DIR=/data/db
      - MONGO_LOG_DIR=/dev/null
    volumes:
      - "mongodb_data:/data/db"
    command: "mongod --smallfiles --logpath=/dev/null"
    networks:
      - cocoannotator