def submit(): api_key = "acbb79b92da3e408762784310464ec42" challenge = crowdai.Challenge("crowdAIMappingChallenge", api_key) result = challenge.submit("predictions.json") print(result)
import crowdai import mido midi_file_path="C:\\Users\\Deeps\\Documents\\School\\MIT807\\Code\\output\\sixtEncoDeco.mid" API_KEY="<2a428240c13c65e18cea6b8a2f73ef03>" midifile = mido.MidiFile(midi_file_path) assert midifile.length >20 - 10 and midifile.length < 3600 + 10 assert len(midifile.tracks) == 1 assert midifile.type == 0 challenge = crowdai.Challenge("AIGeneratedMusicChallenge", API_KEY) challenge.submit(midi_file_path) """ Common pitfall: `challenge.submit` takes the `midi_file_path` and not the `midifile` object """
# Remember to generate the random predictions by running inside the repository # python generate_random_prediction.py > data/predictions.txt from __future__ import print_function import crowdai import argparse parser = argparse.ArgumentParser(description='Submit the result to crowdAI') parser.add_argument('--api_key', dest='api_key', action='store', required=True) parser.add_argument('--predictions', dest='predictions', action='store', required=True) args = parser.parse_args() challenge = crowdai.Challenge("CriteoAdPlacementNIPS2017", args.api_key) scores = challenge.submit(args.predictions, small_test=True) """ NOTE: In case of predictions for the actual test set, please pass `small_Test=False` scores = challenge.submit(args.predictions, small_test=False) """ print(scores) """ { "impwt_std": 0.00064745289554913, "ips_std": 2.6075584296658, "snips": 6603.0581686235, "max_instances": 4027, "ips": 24.30130041425, "impwt": 0.0036803099099937, "message": "", "snips_std": 17.529346134878,
import crowdai import argparse from sklearn.svm import SVR import numpy as np parser = argparse.ArgumentParser(description='Submit the result to crowdAI') parser.add_argument('--api_key', dest='api_key', action='store', required=True) args = parser.parse_args() # Create the challenge object by authentication with crowdAI with your API_KEY challenge = crowdai.Challenge("OpenSNPChallenge2017", args.api_key) #Load training data x_train = np.load("data/subset_cm_train.npy") y_train = np.load("data/train_heights.npy") x_test = np.load("data/subset_cm_test.npy") #Replace nan values in the training and testing set with an arbitrary number inds = np.where(np.isnan(x_train)) x_train[inds] = -100 inds = np.where(np.isnan(x_test)) x_test[inds] = -100 # Instantiate a linear model clf = SVR(C=1.0, epsilon=0.2) clf.fit(x_train, y_train) # Predict the heights for the test set heights = clf.predict(x_test)
def make_submission(submission_filepath, logger, params): api_key = params.api_key challenge = crowdai.Challenge("crowdAIMappingChallenge", api_key) logger.info('submitting predictions to crowdai') challenge.submit(submission_filepath)
raise Exception("Unable to find the test files at: " "`data/crowdai_fma_test/*.mp3`.\n" "Are you sure you downloaded the test set and " "placed it at the right location ? ") for _file in TEST_FILES: # NOTE: This expects that you have already downloaded the test set # and it is available inside the data folder. _track_id = _file.split("/")[-1].replace(".mp3", "") """ Generate predictions """ predictions = np.random.rand((len(CLASSES))) predictions = softmax(predictions) if np.sum(predictions) > 1.1: print(predictions) row = {} row['file_id'] = _track_id for _idx, _class in enumerate(CLASSES): row[_class] = predictions[_idx] writer.writerow(row) csvfile.close() challenge = crowdai.Challenge("WWWMusicalGenreRecognitionChallenge", API_KEY) response = challenge.submit(output_path) print(response['message'])
from __future__ import print_function import crowdai import argparse import mido parser = argparse.ArgumentParser(description='Submit the result to crowdAI') parser.add_argument('--api_key', dest='api_key', action='store', required=True) parser.add_argument('--midi_file', dest='midi_file', action='store', required=True) args = parser.parse_args() midifile = mido.MidiFile(args.midi_file) assert midifile.length > 3600 - 10 and midifile.length < 3600 + 10 assert len(midifile.tracks) == 1 challenge = crowdai.Challenge("AIGeneratedMusicChallenge", args.api_key) challenge.submit(args.midi_file)
x = random.randint(0, IMAGE_WIDTH - padding) y = random.randint(0, IMAGE_HEIGHT - padding) width = random.randint(0, IMAGE_WIDTH - x) height = random.randint(0, IMAGE_WIDTH - y) _result["bbox"] = [x, y, width, height] _segmentation = [] for k in range(SEGMENTATION_LENGTH * 2): _segmentation.append(np.random.randint(0, IMAGE_WIDTH)) _segmentation.append(np.random.randint(0, IMAGE_HEIGHT)) _result["segmentation"] = [_segmentation] results.append(_result) print("Writing results to : data/result_annotations.json") with open("data/result_annotations.json", "w") as fp: fp.write(json.dumps(results)) print("Writing Complete !") print("Submitting to crowdAI...") parser = argparse.ArgumentParser(description='Submit the result to crowdAI') parser.add_argument('--api_key', dest='api_key', action='store', required=True) args = parser.parse_args() import crowdai api_key = args.api_key challenge = crowdai.Challenge("crowdAIMappingChallenge", api_key) result = challenge.submit("data/result_annotations.json") print(result)
import json import numpy as np import crowdai api_key = 'bc2f7cddee3eb0c65f0737ec22bf1c48' #'a96a541f34d8c0d688871eab01ba8057' challenge = crowdai.Challenge('crowdAIMappingChallenge', api_key) result = challenge.submit('newpredictions.json') print(result)
#!/usr/bin/env python try: import crowdai except: raise Exception("Please install the `crowdai` python client by : pip install crowdai") import argparse parser = argparse.ArgumentParser(description='Upload saved docker environments to crowdai for grading') parser.add_argument('--api_key', dest='api_key', action='store', required=True) parser.add_argument('--docker_container', dest='docker_container', action='store', required=True) args = parser.parse_args() challenge = crowdai.Challenge("Learning2RunChallengeNIPS2017", args.api_key) result = challenge.submit(args.docker_container) print(result)
#!/usr/bin/env python import argparse import crowdai desc = 'Submit a prediction to be graded by crowdAI.' parser = argparse.ArgumentParser(description=desc) parser.add_argument('--api_key', dest='api_key', type=str, required=True, help='your crowdAI API key') parser.add_argument('file', metavar='submission.csv', type=str, help='the CSV file to be submitted') args = parser.parse_args() ID = 'WWWMusicalGenreRecognitionChallenge' challenge = crowdai.Challenge(ID, args.api_key) response = challenge.submit(args.file) print(response['message'])
def submit_results(self, api_key="8229d44990cdd9496c4ae53cc9308aed"): challenge = crowdai.Challenge("IEEEInvestmentRankingChallenge", api_key) result = challenge.submit(os.path.join(self.path_to_results, self.result_file_name), round=2) print(result)