Package: image-source-server
image_source_serverServer forImage SourceappUsageInstallFlaskif you haven't already (Flask comes preinstalled if you have Anaconda)pip install FlaskInstall image_source_server.pip install image_source_serverCreate an ImageSourceServer object, implement the "train" and "predict" methods and pass it into the ImageSourceServer constructor (example shown below)from image_source_server import ImageSourceServer

def train(train_dir_uri, params):
    print('Training on data from : ' + train_dir_uri)
    print('Train params : ' + str(params))
    return 'Trained' # return value is returned to the Image Source App in the HTTP Response

def predict(img_uri):
    print('Predicting on ' + img_uri)
    return 'Cat'  # return value is returned to the Image Source App in the HTTP Response

serv = ImageSourceServer(train=train, predict=predict)
serv.run()"train" method will be called with the uri of the folder containing the training images when "Train" button is pressed on the app.train(train_dir_uri, params)
    train_dir_uri - uri of the directory containing folders which in turn contain the images
    params - training parameters (list of key-value pairs) passed from the Image Source app"predict" method will be called with the uri of the image provided by the app for prediction. The value returned by the predict method will be returned to the app and displayed as an alert to the user.predict(image_uri)
    image_uri - the uri of the image on which the prediction needs to be made
    return value - will be converted to a string (if not already a string) and sent to the Image Source app. This string will be displayed as an alert to the user"serv.run()" starts the serverInstall the Expo app.Play Store Link(Although there is an Expo app for iOS, Apple doesn't allow for other apps to be run on the Expo app. An iOS stand alone Image Source app release is planned in future.)VisitImage Sourceapp page on expo. Scan the QR code on your Expo android app to open the Image Source app.Run the server script (and make sure you've called the "run" method)Configure the app to work with serverGo to "Settings" tab on the Image Source app.Click on "Add" button.Next to the "Host" entry, enter your SERVER'S IP ADDRESS(Example: 192.168.1.130 ).Next to the "Port" entry, enter your SERVER'S PORT NUMBER. By default, image source server runs on port 12221. So, if you haven't passed in an argument in the the ImageSourceServer constructor to specify a custom port, enter 12221 here.Click "Save".The Image Source app is now configured to send the data to the specified server. You may add other servers too (but one server is mandatory).Curating and sending dataClick on "Select Image" and select the image and it's category.Click on "Submit" to add the image to the app.When the pics need to be transfered to server, click on "Send all images to server". This transfers all images to server. You may then check 'data/images' directory on the folder where the server was run to check for the received pics.TrainingGo to "Train" tab on the Image Source app.Click on "Add Parameter" to add training parameters. Training parameters are key value pairs. All the key value pairs will be sent to the server which will then pass it to the "train" method.Click on the "Train" button to start training.PredictionGo to "Predict" tab on the Image Source app.Select the image to be sent to server for prediction.Click on "Submit"The image will be sent to server and the prediction will be displayed as an alert once the server responds.