This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"github.com/aws/aws-lambda-go/lambda" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch/#create-custom-coco-dataset | |
# Aimed at solving problem for: https://mmdetection.readthedocs.io/en/v2.25.0/tutorials/customize_dataset.html | |
# haven't tested script with multi-category, only tested with binary classification | |
import json | |
import numpy as np | |
from skimage import measure # (pip install scikit-image) | |
from shapely.geometry import Polygon, MultiPolygon # (pip install Shapely) | |
from PIL import Image # (pip install Pillow) | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
For TensorFlow v2 and Keras you can limit gpu memory usage a couple of different ways, just add one of the following early on in your scripts | |
""" | |
import tensorflow as tf | |
physical_devices = tf.config.experimental.list_physical_devices('GPU') | |
tf.config.experimental.set_memory_growth(physical_devices[0], True) | |
""" | |
or |