This file contains 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
{ | |
"content": "https://s3-us-west-2.amazonaws.com/com.dataturks.trivia/cars5.mp4", | |
"annotation": [{ | |
"startTime": 0.682497, | |
"endTime": 4.764457, | |
"label": "Car", | |
"shape": "rectangle", | |
"positions": [{ | |
"points": [ | |
[0.2390829694323144, 0.5667151868025229], |
This file contains 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
# coding: utf-8 | |
import json | |
import matplotlib.pyplot as plt | |
from PIL import Image, ImageDraw | |
import numpy as np | |
import cv2 | |
# Find OpenCV version | |
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.') |
This file contains 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
#This script has been solely created under dataturks. Copyrights are reserved | |
#EXAMPLE USAGE | |
#python3 keras_json_parser.py --json_file "flower.json" --dataset_path "Dataset5/" --train_percentage 80 --validation_percentage 20 | |
import json | |
import glob | |
import urllib.request | |
import argparse |
This file contains 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
@echo off | |
set _DIR_PATH=%1 | |
set _DATATURKS_OUT=dataturks_urls.txt | |
echo.>%_DATATURKS_OUT% | |
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b | |
set ip=%ip:~1% | |
This file contains 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
from skimage import draw | |
from skimage import io | |
import numpy as np | |
import urllib.request | |
import json | |
import logging | |
import os | |
import sys | |
This file contains 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
import spacy | |
################### Train Spacy NER.########### | |
def train_spacy(): | |
TRAIN_DATA = convert_dataturks_to_spacy("dataturks_downloaded.json"); | |
nlp = spacy.blank('en') # create blank Language class | |
# create the built-in pipeline components and add them to the pipeline | |
# nlp.create_pipe works for built-ins that are registered with spaCy | |
if 'ner' not in nlp.pipe_names: | |
ner = nlp.create_pipe('ner') | |
nlp.add_pipe(ner, last=True) |
This file contains 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
############################################ NOTE ######################################################## | |
# | |
# Creates NER training data in Spacy format from JSON downloaded from Dataturks. | |
# | |
# Outputs the Spacy training data which can be used for Spacy training. | |
# | |
############################################################################################################ | |
def convert_dataturks_to_spacy(dataturks_JSON_FilePath): | |
try: | |
training_data = [] |
This file contains 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
def train_spacy(training_pickle_file): | |
#read pickle file to load training data | |
with open(training_pickle_file, 'rb') as input: | |
TRAIN_DATA=pickle.load(input) | |
nlp = spacy.blank('en') # create blank Language class | |
# create the built-in pipeline components and add them to the pipeline | |
# nlp.create_pipe works for built-ins that are registered with spaCy | |
if 'ner' not in nlp.pipe_names: |
This file contains 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
import argparse | |
import sys | |
import os | |
import json | |
import logging | |
import pickle | |
############################################ NOTE ######################################################## | |
# |
This file contains 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
import argparse | |
import sys | |
import os | |
import json | |
import logging | |
import requests | |
from PIL import Image | |
################### INSTALLATION NOTE ####################### | |
############################################################## |