【LightWeight】Understanding EfficientNet+EfficientDet paper w/ code

1. EfficientNet from youtube

img01 img02 img03 img04 img05 img06 img07 img08 img09 img10 img11 img12 img13 img14 img15 img16 img17 img18 img19 img20 img21 img22 img23 img24 img25 img26 img27 img28 img29 img30 img31 img32

2. lukemelas/EfficientNet-PyTorch

  • Github-Link : EfficientNet-PyTorch

  • EfficientNet은 a family of image classification models 이다. Based on MnasNet in term of AutoML, Compound Scaling.

  • Simply, Model 불러와 Classification 수행하기

    • import json
      from PIL import Image
      import torch
      from torchvision import transforms
          
      from efficientnet_pytorch import EfficientNet
      model = EfficientNet.from_pretrained('efficientnet-b0')
          
      # 0. Preprocess image
      tfms = transforms.Compose([transforms.Resize(224), transforms.ToTensor(),
          transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),])
      img = tfms(Image.open('img.jpg')).unsqueeze(0)
      print(img.shape) # torch.Size([1, 3, 224, 224])
          
      # 0. Load ImageNet class names
      labels_map = json.load(open('labels_map.txt'))  # 이미 EfficientNet-Pytorch/examples/simple/labels_map.txt 있다.
      labels_map = [labels_map[str(i)] for i in range(1000)]
          
      # 1. For Classify
      model.eval()
      with torch.no_grad():
          outputs = model(img)
          
      # 2. For Feature Extractor
      features = model.extract_features(img)
      print(features.shape) # torch.Size([1, 1280, 7, 7])
      
  • Pytorch Efficient-Net model Code



3. EfficientDet from youtube

img01 img02 img03 img04 img05 img06 img07 img08 img09 img10 img11 img12 img13 img14 img15 img16 img17 img18 img19 img20 img21 img22 img23 img24 img25 img26 img27 img28 img29 img30 img31 img32

4. zylo117/Yet-Another-EfficientDet-Pytorch


© All rights reserved By Junha Song.