Code Monkey home page Code Monkey logo

Pix2Pix for Fruits

This is a mini project where is try to try pix2pix myself, but on fruits. Dataset used is from COCO-dataset

You can find the original paper here.

You can also find the guide from tensorflow.orh here.

Objective

Create a model that is able to generate fruits on an any image

Setting up environment

Take note that i am using ubuntu

  1. Install anaconda
  2. On your terminal, run conda create env -f environment.yml
  3. On your terminal. run conda activate pix2pix_env

Generating Data

  1. Make sure that you have activated the conda environment
  2. Download COCO training and validation dataset and annotations
  3. Edit the following variables inside process_data.py
training_data_dir
validation_data_dir
training_annotation_file
validation_annotation_file
  1. On your terminal, run python proces_data.py
  2. The images will now be saved inside the data/train and data/val folders
  3. There are 4193 training data and 200 testing data

Training

  1. Make sure that you have activated the conda environment
  2. Make sure you have generated the training and validation dataset
  3. Edit the hyperparameters as you like at the top of the train.py file
  4. Run python train.py. This might take some time. On a RTX2060 Super, it took 4~5 min for 1 epoch
  5. checkpoints are saved in the training_checkpoints folder. Running train.py again will start from the latest checkpoint from the checkpoint folder

Results

The result after running 100 epoch is not great. The results might be better if we use datasets which are more 'fruits focused', eg. with fruits as the main focus of the image.

Below are some of the samples of the better results

sample 1 sample 2 sample 3

Future improvements

  1. Create a dataset which is more 'fruits focused', maybe also crop images with fruits so that the model can learning might be more relevant
  2. Run the training on more epochs. The example on tensorflow was ran on 200 epochs, which is 2x this project, and has more dataset

Ernest Lim's Projects

camera-sample-app icon camera-sample-app

A simple camera app that allows you to run ML predictions on the video input

darknet icon darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )

dataset-converters icon dataset-converters

A conversion toolset between different object detection and instance segmentation annotation formats

labelimg_obb icon labelimg_obb

:metal: LabelImg is a graphical image annotation tool and label object bounding boxes in images. This fork updates to tool to support "oriented" bounding boxes (OBB).

testbeds icon testbeds

a collection of stuffs that I fiddled around with

yolov7 icon yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.