open-mmlab / mmfashion

Open-source toolbox for visual fashion analysis based on PyTorch
https://open-mmlab.github.io/
Apache License 2.0
1.27k stars 283 forks source link

no output to segmentation #113

Open AhmedNageh08 opened 3 years ago

AhmedNageh08 commented 3 years ago

@veralauee i run this command !python /content/mmfashion/mmdetection/tools/demo.py --checkpoint /content/drive/MyDrive/epoch_15.pth --config configs/mmfashion/mask_rcnn_r50_fpn_1x_fixed.py --input demo/imgs/01_4_full.jpg but nothing happens with no error .. i'm running on cloab so i edited demo.py file to import argparse

from mmdet.apis import inference_detector, init_detector

def parse_args(): parser = argparse.ArgumentParser( description='Test Fashion Detection and Segmentation') parser.add_argument( '--config', help='mmfashion config file path', default='configs/mmfashion/mask_rcnn_r50_fpn_1x.py') parser.add_argument( '--checkpoint', type=str, required=True, help='the checkpoint file to resume from') parser.add_argument( '--input', type=str, help='input image path', default='demo/imgs/01_4_full.jpg')

def main(): args = parse_args()

# build the model from a config file and a checkpoint file
model = init_detector(args.config_file, args.checkpoint, device='cuda:0')

# test a single image and show the results
img = args.input
result = inference_detector(model, img)

# visualize the results in a new window
# or save the visualization results to image files

model.show_result(
    img, result, model.CLASSES, out_file=img.split('.')[0] + '_result.jpg')
from IPython.display import Image
Image(filename=img.split('.')[0] + '_result.jpg') 

thanks in advance

AhmedNageh08 commented 3 years ago

@veralauee i hope you can help me

KhubbatulinMark commented 3 years ago

@AhmedNageh08 Could you show the changed config mask_rcnn_r50_fpn_1x_fixed.py?