Skip to content

Requirements and Specifications

0jihunlee edited this page Mar 14, 2024 · 80 revisions

Project: Spire

image

Table of Contents

1. Document Revision History

Version Date Description
Rev 1.0 2023-10-08 Initial version
Rev 1.1 2023-10-22 Fixed minor errors and typos
Rev 1.2 2023-10-22 Modified views and Android workflow
Rev 1.3 2023-11-05 Modified views and Android workflow
Rev 1.4 2023-11-11 Modified views and updated user stories
Rev 1.5 2023-11-19 Modified views
Rev 1.6 2023-12-03 Modified Android Workflow
Rev 1.7 2023-12-09 Modified Competitive Landscape
Rev 1.8 2023-12-10 Added unregister and auto-masking user stories
Rev 1.9 2024-02-25 Updated image generation latency

2. Project Abstract

In May 2023, the camera app SNOW introduced an AI-driven profile photo feature and it surpassed 1.5 million users in just a month. Also, the rise of influencers who are uploading AI-generated content highlights the potential of this emerging trend. The method of self-expression has been constantly changing. Now, the digital age has encountered a new era of self-expression, the new trend with the use of AI-generated imagery on social platforms. These images, transcending the confines of reality, allow users to visualize any imagined environment or situation.

Recognizing this shift in digital self-expression, Spire is designed to be a dedicated hub where users can easily integrate and share AI-generated images. Also, users can effortlessly regenerate their images in any way they desire by using our user-friendly interface, which enables simple prompting and image mask drawing with the aid of auto-generated masks. This will lower the threshold of utilizing AI and foster creativity by offering a unique platform where individuals can share their enhanced imaginative expressions, enriched by generative AI.

3. Customer

Spire targets customers who want to create and share their inspiration with people.

To be specific, our main customers will be,

Those who are looking for the SNS, where they can express their unique identity and creativity with no physical limits.

Those who are looking for an easy AI image generation tool, which helps to create their own images with the desired situation

4. Competitive Landscape

Group 15

Compared to other similar services, Spire will be a unique social platform where users can share their prompt-based AI-recreated images through a user-friendly generation interface.

In the competitive landscape, our app, Spire, distinguishes itself both technically and service-wise. While existing services like SNOW AI profile and Tweak are limited by the expensive computational cost of the backward pass and the restrictions in the manifold of generated images (only human profile image domain), Spire mitigates these issues, optimizing the diffusion model’s performance. Our application of the Langevin MCMC is enhanced, overcoming the limitations faced by apps like Draw Things: AI generation, where image generation is highly dependent on user inputs and text prompts. Spire employs a panoptic segmentation model, making image synthesis more user-friendly and less dependent on the technical expertise of the user. It can generate and recommend masks of objects in the image and ensure desired image output by providing various inference results. Moreover, Spire stands as a unique social platform, fostering a community where users can easily share and explore AI-recreated images, making it not only a tool for image generation but also a hub for social interaction and content discovery.

5. Functional Requirements

5.1 Use Cases

Goal User wants to register and log in to access Spire
Actor New user or returning user
Pre-conditions User is on the Spire login page
Main Scenario 1. New user clicks on the "Sign up" button
2. The user enters the user's email address
3. A verification email is sent to the user’s email address
4. The user inputs verification code
5. The user fills in the required information including password and username
6. The user is now registered and logged in, and is directed to the Spire homepage
Extensions (Failure) 3a. If the user's email verification fails, an option to resend the verification email is provided
5a. If the user enters incomplete or invalid information, an error message is displayed prompting them to correct the entries
Variations 1. The returning user enters their email and password and clicks on the "Log In" button
Goal User wants to modify their profile information
Actor Registered User who wants to update profile
Pre-conditions User is logged in and is on their profile page
Main Scenario 1. User clicks on the "Edit Profile" button
2. The user is directed to the profile editing screen
3. User updates their username, bio, profile picture, or other profile information
4. User reviews the changes
5. The user clicks the "Save" button
6. The user receives a confirmation message, and the updated information is reflected on their profile
Extensions (Failure) 5a. If the user tries to save with incomplete or invalid information, an error message is displayed prompting them to correct the entries
Variations
Goal User wants to edit an image as one desired and post
Actor User who wants to edit an image and post
Pre-conditions User is at image editing screen
Main scenario 1. User selects an image to edit from the album
2. The user draws a mask on the image to specify the region to edit
3. User types a text prompt how to modify the image
4. The user waits to generate an image and types the content for the post
5. The user gets the generated image and uploads the post
Extensions (Failure) 5a. The user is unsatisfied with the generated image result, then the regenerate option is given.
Variations 2. User selects an auto-generated mask given by the segmentation model and further modifies the mask

5.2 User Stories

5.2.1 Authentication

5.2.1.1 Register and Login with Email and Password

  • User Story
    As a first-time user, I can register and log in through e-mail and password, so that I can now use Spire with my new account.
  • User Acceptance Criteria
    Given that the user is on the Spire login page,
    When the user selects "Sign up" and enters a valid email, password, and username,
    Then the user should be registered and logged into Spire with a new account.

5.2.1.2 Automatic Login

  • User Story
    As a convenience-loving user, I can login automatically, so that I don’t have to log in twice for a short period.
  • User Acceptance Criteria
    Given that the user has previously logged into Spire,
    When the user opens the Spire app within a short period,
    Then the user should be automatically logged in without entering credentials.

5.2.1.3 Logging Out

  • User Story
    As a security-conscious user, I can log out of my Spire account, so that I can ensure my account is secure when I'm not using the app.
  • User Acceptance Criteria
    Given that the user is logged into Spire and is on the Spire search page,
    When the user selects the "Logout" option,
    Then the user should be logged out and redirected to the Spire login page.

5.2.1.4 Unregister

  • User Story
    As a leaving user, I can delete my Spire account, so that I can ensure all my data on Spire is deleted.
  • User Acceptance Criteria
    Given that the user is logged into Spire and is on the Edit Profile page,
    When the user selects the "Delete Account" option,
    Then the user's account is deleted and all the corresponding interaction data are also deleted.

5.2.2 User

5.2.2.1 Customize Profile

  • User Story
    As a personalized user, I can customize my profile and add a profile picture, so that I can personalize my presence on Spire.
  • User Acceptance Criteria
    Given that the user is on their Spire profile page,
    When the user selects "Edit Profile" and makes changes,
    Then those changes should be saved and reflected on their public profile.

5.2.2.2 Search Users by Username and Follow User

  • User Story
    As a social user who wants to make a connection, I can search users by usernames, so that I can see their posts or follow them.
  • User Acceptance Criteria
    Given that the user is on the Spire search page,
    When the user enters a username into the search bar,
    Then users matching the search query should be displayed (with the following status) and the user can request follow via profile page.

5.2.2.3 Accept or Reject Follow Requests

  • User Story
    As a privacy-conscious user, I can accept or reject other users' follow requests, so that I can control who gets to follow me and view my posts on Spire.
  • User Acceptance Criteria
    Given that the user has received a follow request on Spire,
    When they choose to either accept or reject the request,
    Then the request should be processed accordingly, and the follower's list should be updated if the request is accepted.

5.2.3 Post

5.2.3.1 Create and Share a New Post

  • User Story
    As a sociable user, I can create a new post and share it with my friends, so that I can communicate and engage with others on Spire.
  • User Acceptance Criteria
    Given that the user is on the post-write page,
    When they create a new post with the generated image and text content,
    Then the post should be visible to their friends or followers based on the selected privacy settings.

5.2.3.2 Delete or Edit Posts

  • User Story
    As a post-owning user, I can delete or edit my texts, so that I can have control over the content I share.
  • User Acceptance Criteria
    Given that the user is viewing their post,
    When they select "Edit" or "Delete",
    Then the post should be either modified or removed from Spire.

5.2.3.3 Interact with Posts

  • User Story
    As an interactive user, I can view and leave likes or comments on posts made by other users, so that I can interact with their content and show my appreciation or thoughts.
  • User Acceptance Criteria
    Given that the user is viewing a post,
    When they select "Like" or "Comment",
    Then their interaction should be recorded and displayed.

5.2.4 Image Generation

5.2.4.1 Recreate Images with Prompts

  • User Story
    As a creative user, I can use prompts to recreate my original image, so that I can create unique and personalized visuals.
  • User Acceptance Criteria
    Given that the user is in the image generation section of Spire,
    When they upload an image from gallery and apply a mask and a creative prompt,
    Then the image should be recreated according to the selected prompt.

5.2.4.2 Apply Auto-Generated Masks

  • User Story
    As a draw-hating user, I can get auto-generated masks of objects in my original image, so that I can easily apply masks without manual drawing.
  • User Acceptance Criteria
    Given that the user is in the image generation section of Spire,
    When they request auto-painting with the original image,
    Then the list of objects in the input image and the corresponding masks are automatically generated.

5.2.4.3 Create New Images Only from Prompts

  • User Story
    As an explorative user, I can write some text prompts to generate an image, so that I can create a creative image.
  • User Acceptance Criteria
    Given that the user is creating a new image from a text prompt,
    When they write some text prompt,
    Then the image should be generated.

5.2.4.4 Access Image Recreation Instructions

  • User Story
    As a learning user, I can get aid instructions on image recreation within the app, so that I can generate images easily even if I am a beginner.
  • User Acceptance Criteria
    Given that the user is new to image recreation,
    When they access the image generation section,
    Then instructional content should be available to guide them through the process.

5.2.5 Feed

5.2.5.1 Refresh Feed

  • User Story
    As a real-time user, I can refresh my feed anytime, so that I can get the latest updates and posts from my connections.
  • User Acceptance Criteria
    Given that the user is viewing their Spire feed,
    When they pull to refresh,
    Then the feed should update to display the latest posts and interactions.

5.2.5.2 Browse Posts on Feed

  • User Story
    As a connected user, I can effortlessly browse various posts through the feed function, so that I can stay informed on the latest posts, likes, and comments within my network.
  • User Acceptance Criteria
    Given that the user is scrolling through their Spire feed,
    When new content is available,
    Then the feed should auto-populate with new posts, likes, and comments.

5.2.6 Notification

5.2.6.1 Receive Notifications

  • User Story
    As an alert user, I can receive notifications for post interactions and new connections, so that I can stay updated and engaged with Spire.
  • User Acceptance Criteria
    Given that the user has new interactions or connections on Spire,
    When they check their notifications tab,
    Then all recent interactions and connection requests (post like, new comment, comment like, follow request, follow acceptance etc.) should be displayed.

5.3 User Acceptance Test

We will use 5 following user stories and acceptance criteria for UAT:

6. Non-functional Requirements

Requirement Domain Description
1 Image Generation Latency Image Generation To reduce image generation inference latency, we adopt adversarial diffusion distillation model. The expected wall time including image generation and sending time is about 5 seconds.
2 Infinite Scroll Feed & User Profile The infinite scroll is applied to decrease the latency from loading the whole data at once. It must load additional content seamlessly with a maximum delay of 1 second to ensure a smooth and uninterrupted user experience.
3 Security Authentication To enhance security in FastAPI's JWT-based login, prioritize data encryption, separate access and refresh tokens, and ensure HTTPS communication. Hash user passwords, validate JWTs, and use strong secret keys for signing and encrypting. Implement token renewal strategies, set suitable token lifetimes, and protect against CSRF attacks while securing client-side token storage. This also enables automated login which enhances usability.
4 Network Handling Reliability & Usability To maintain reliability and usability even with unstable network connections, implement robust error handling and retry mechanisms. Additionally, enhance the user experience by displaying loading indicators, such as a loading circle and shimmer effects, during data retrieval. This approach ensures users are informed about the ongoing process, reducing perceived latency and improving overall user satisfaction.

7. User Interface Requirements

7.1 Workflow

image

7.2 Views

image

7.2.1 Initialize

  • Starting page

7.2.2 Login

  • User can log in with e-mail and password
  • Login will be automatic until manual logout

7.2.3.1 Email Verification

  • Sends email with 6 digit verification code
  • Can only proceed to next step when the code is correct
  • User can request email resend

7.2.3.2 Register

  • User can register a new account
  • Requires e-mail, password, and username only. No full name is required
  • If the register is completed, the user will log in automatically
  • User can update bio later
image

7.2.4 Feed

  • List of posts
  • If the user wants to see details or comments, we will show Post page instead

7.2.5 Post

  • Includes writer's profile image, username, last updated time, text, image, likes and comments
  • User can like a post and leave a comment

7.2.6 Bottom Sheet

  • Select how to create image for a new post
  • Pops up when the center button is clicked
  • Can choose to take a picture from camera, select image from gallery, or create a new image from scratch using prompt.
image

7.2.7 Notifications

  • Include recent notifications
  • We will only send notifications about likes, comments, and friend-requests

7.2.8 Search

  • Can search users
  • Initially, shows recent search results
  • Displays the users that contain the text in username when the user enters the text
image

7.2.9 Select Image

  • Image-creating process
  • User may select only one image
  • Should be cropped into square afterwards

7.2.10 Camera

  • User may take only one photo
  • Should be cropped into square afterwards

7.2.11 Prompt Dialog

  • Text to image generation from scratch
  • Does not select an image
image

7.2.12 Mask & Edit

  • User can edit only part of the selected image via prompt
  • User must draw a mask on the part of the image they want to edit
  • User also can use auto-generated masks

7.2.13 Select an Image

  • Display the loading icon until image editing has been done on the server
  • Display edited image(s) if done, the user can view several pictures through a carousel view
  • User can compare the edited image(s) with the original one, select an image to upload and regenerate with the same mask and prompt
  • User can write text even image is still editing
  • User can download an image without writing a post
image

7.2.14 Profile

  • Show username, profile image, posts
  • Show the number of friends and edit profile menu if the profile is mine
  • Show add friend button if the profile is not mine, this button may be disabled if the user is already a friend
image

7.2.15 Edit Profile

  • User may upload a new profile image, edited image is of course possible
  • User can change the password, set a new username, or write a bio
  • User can log out from Spire

7.2.16 Followers

  • User can browse through their followers
  • User can accept or deny the following requests

7.2.17 Followings

  • User can browse through their following users