Skip to content

FalconCV is an open-source python library that offers developers an interface to interact with some of the most popular computer vision frameworks, such as Tensorflow Object detection API and Detectron.

License

Notifications You must be signed in to change notification settings

OpenSciML/FalconCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FalconCV Logo

made-with-python TensorFlow 2.2

GitHub forks GitHub stars GitHub watchers

FalconCV

FalconCV is an open-source Python library that offers developers a high-level API to interact with some of the most popular computer vision frameworks, such as TensorFlow Object detection API and Detectron.

The main objective behind it is to unify the set of tools available and simplify the use of them. This library is focused mainly on Computer Vision practitioners but also is flexible enough to allow researchers to configure the models at a low-level.

Supported frameworks

Installation

Option 1: Install FalconCV from Pip

pip install falconcv

Option 2: Install FalconCV from GitHub using Poetry

git clone https://github.com/haruiz/FalconCV
cd FalconCV
poetry install

Usage

Datasets Module

OpenImages example

from falconcv.data import OpenImages
from falconcv.util import FileUtils
from pathlib import Path
import uuid

if __name__ == '__main__':
    # Create the dataset
    ds = OpenImages(
        version=6,  # versions 5 and 6 supported
        split="train",
        task="detection"
    )
    print(ds.home())  # print dataset home    
    print(ds.available_labels)
    images_folder = Path("./images")
    images_folder.mkdir(exist_ok=True)
    FileUtils.clear_folder(images_folder)
    # Download images
    for batch_images in ds.fetch(labels=["cat", "Dog"], n_images=100, batch_size=32):
        for image in batch_images:
            filename = f"{str(uuid.uuid4())}.jpg" # generate unique name
            image.save(images_folder.joinpath(filename))  # save image to disk

Models module

TensorFlow Object Detection example

Training a custom model:

from falconcv.models import ModelBuilder

if __name__ == '__main__':
    config = {
        "checkpoint_uri": "<Model uri from the zoo>",
        "pipeline_uri": "<Config uri from zoo>",
        "images_folder": "<Images folder path>",
        "output_folder": "<output dir>",
    }
    with ModelBuilder.build(config=config) as model:
        model.train(epochs=5000, ratio=0.8, batch_size=32)
        # model.to_saved_model()
        # model.to_tflite()

Inference using a trained model

from falconcv.models import ModelBuilder
if __name__ == '__main__':
    with ModelBuilder.build("<saved model path>", "<labels map file>.pbx") as model:        
        img = model("<image file|uri>", threshold=0.5)
        img.plot(model.labels_map)   

How to contribute

We are encouraging anyone around the world to contribute to this project. So, we principally need help improving the documentation, translation to other languages (which includes but not limited to French, Spanish, Portuguese, Arabian, and more) or adding new features. Fork the repository and run the steps from Install FalconCV from GitHub source using poetry. Any questions, do not hesitate to write an email to [email protected]. We are excited to see where this project goes.

Send a pull request!

Contributors

Citation

@misc {FalconCV,
    author = "Henry Ruiz, David Lopera",
    title  = "FalconCV, an open-source transfer learning library that offers developers a high level API to interact with some of the most popular computer vision frameworks",
    url    = "https://github.com/haruiz/FalconCV",
    month  = "jun",
    year   = "2020--"
}

Credits

License

Free software: MIT license

About

FalconCV is an open-source python library that offers developers an interface to interact with some of the most popular computer vision frameworks, such as Tensorflow Object detection API and Detectron.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages