This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Guide: Generating and Using Topic-Specific Learning Assistant Backend | |
https://github.com/JupyterJones/frontend | |
This document outlines how to use the Flask-based App Generator to create new topic-specific FastAPI Backend Applications for your learning assistant project.1. OverviewThe system consists of two main Python scripts:Flask App Generator (app_builder.py - your second script):A Flask web application that provides a user interface to input a topic name and a structured prompt.It uses a master template (template_app_v2.py) to generate a new, customized FastAPI backend application tailored to the specified topic.It also creates necessary directories and the topic-specific structured prompt file.FastAPI Backend Template (template_app_v2.py - your first script):A comprehensive FastAPI application template designed to serve as a backend for a learning assistant.It includes features like Q&A with Gemini, conversation history, file management, vector search with ChromaDB, context-enhanced responses, conversati |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
import sqlite3 | |
DATABASE = "notes.db" | |
conn = sqlite3.connect(DATABASE) | |
from datetime import datetime | |
conn.text_factory = str | |
c = conn.cursor() | |
if len(sys.argv) < 3: | |
print ("\n******* NOTE - Notes Editor ******") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import numpy as np | |
import logging | |
import glob | |
import random | |
import uuid | |
# Set up logging | |
logging.basicConfig(level=logging.INFO, format='%(levelname)s - %(message)s') | |
def zoom_pan_nonlinear1(input_path, output_path): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from moviepy.editor import VideoFileClip, VideoClip, concatenate_videoclips | |
from PIL import Image | |
import numpy as np | |
from sklearn.cluster import KMeans | |
import random | |
import os | |
# Configure logging | |
logging.basicConfig(filename='script_log.log', level=logging.DEBUG) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageFilter | |
import os | |
import cv2 | |
import random | |
import time | |
path = r"/home/jack/Desktop/HDD500/SCRIPTS/UGLY_DOLLS/" | |
#path = r"crawler4/" | |
base_image = random.choice([ | |
x for x in os.listdir(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/jack/miniconda3/envs/cloned_base/bin/python | |
import os | |
import subprocess | |
import random | |
from sys import argv | |
import uuid | |
import shutil | |
def diag_trans(DIR,output_file): | |
image_dir=DIR | |
# Get a list of image file names in the directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeVideoClip | |
import random | |
import glob | |
def add_title_image(video_path, title_image_path, output_path): | |
# Load the video file and title image | |
video_clip = VideoFileClip(video_path) | |
print(video_clip.size) | |
width, height = video_clip.size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define the paths to your input videos | |
video1='0001.mp4' | |
video2='0002.mp4' | |
video3='0003.mp4' | |
output='real-fish_123.mp4' | |
# Create a text file to list the input videos | |
echo "file '$video1'" > input.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
convert -size 512x666 -background black -fill white -font /home/jack/fonts/Arimo-Regular.ttf -pointsize 30 -gravity center caption:@topic.txt -set delay 4 -loop 0 -coalesce -layers Optimize topic.png |