Context
This project is the final academic project for the course called "OOP1" (Object-Oriented Programming), using Java and taken back in Spring 2023.
Description and goals
The main goal of the project was to demonstrate our understanding of the 4 pillars of OOP (encapsulation, abstraction, inheritance and polymorphism) in a project that searches through images of a local directory, and, as a bonus, on Twitter (now X) using some search string.
Tech stack
- Java 17
Concepts used and developped
- OOP
- API Calls
- JSON Manipulation
Implementation
After weeks of searching on the internet for ways to describe images using Java, I had found nothing. My first intuition was that this task should be achieved by AI (the first AI course was set for the following year).
I came accross Microsoft Cognitive Services which is free for students for the first year of usage.
Structure
The project uses classes, abstract classes and interfaces to achieve the desired behaviour.
The main program, when run on a local directory, tries to find descriptor files in that directory. If none are found, it calls Microsoft Azure Cognitive Services and sends the images in that directory to be described by the service. The service returns a JSON response containing the objects it found in the image. These objects will act as tags/descriptors and are saved in files in the searched directory.
Descriptor files are then parsed and the images whose descriptors contain the desired tag(s) are returned as a result.
Obstacles
The bonus part, consisting of expanding the search to Twitter (now X) failed due to Twitter not approving of the developer account, thus not granting an API key, before the deadline of the project.
However, once accorded, this extention is easy since the base abstract class for an image exists and only needs extending.
Tests
This project does not yet include automated tests, but I have ensured code quality and clarity, and I am aware that some classes/methods can use some refactoring.
I am familiar with unit testing best practices and plan to add tests in future projects.
Demo
You can download and run the source code from the github repository.