Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
2bbdd50
Update box_utils.py
Paarth-mindflix Jan 8, 2025
384b7a7
Added some changes in talking script
Paarth-mindflix Jan 8, 2025
fde3e55
Added some changes in talking script
Paarth-mindflix Jan 8, 2025
3e3f6d8
Added some changes in talking script
Paarth-mindflix Jan 8, 2025
bd6682a
Added some changes in talking script
Paarth-mindflix Jan 8, 2025
3ae45d7
Changed resolution, edited default value of minTracks to 60, assuming…
Paarth-mindflix Jan 9, 2025
18a2c8d
Changed resolution, edited default value of minTracks to 40, assuming…
Paarth-mindflix Jan 9, 2025
0693e43
Your commit message
Paarth-mindflix Jan 9, 2025
ffa0188
Your commit message
Paarth-mindflix Jan 9, 2025
6bdf801
Your commit message
Paarth-mindflix Jan 9, 2025
da68202
Your commit message
Paarth-mindflix Jan 9, 2025
445350b
Your commit message
Paarth-mindflix Jan 9, 2025
b5af8a1
Your commit message
Paarth-mindflix Jan 9, 2025
3ad2b19
Your commit message
Paarth-mindflix Jan 11, 2025
924b269
Your commit message
Paarth-mindflix Jan 11, 2025
e493f03
Your commit message
Paarth-mindflix Jan 11, 2025
99e190c
Your commit message
Paarth-mindflix Jan 11, 2025
b41de0e
Your commit message
Paarth-mindflix Jan 11, 2025
ef044e3
Your commit message
Paarth-mindflix Jan 11, 2025
b647bcc
Your commit message
Paarth-mindflix Jan 11, 2025
d7ec930
Your commit message
Paarth-mindflix Jan 11, 2025
539a696
Your commit message
Paarth-mindflix Jan 12, 2025
ae0727e
Your commit message
Paarth-mindflix Jan 12, 2025
fd8518b
Your commit message
Paarth-mindflix Jan 12, 2025
330ae5f
Your commit message
Paarth-mindflix Jan 12, 2025
7c7350d
Your commit message
Paarth-mindflix Jan 12, 2025
8d4e378
Your commit message
Paarth-mindflix Jan 12, 2025
46c50fd
Your commit message
Paarth-mindflix Jan 12, 2025
48740e4
Your commit message
Paarth-mindflix Jan 12, 2025
679e50f
Your commit message
Paarth-mindflix Jan 12, 2025
af17cfb
Your commit message
Paarth-mindflix Jan 12, 2025
9cb001d
Your commit message
Paarth-mindflix Jan 12, 2025
6c2e15f
Your commit message
Paarth-mindflix Jan 12, 2025
efd61dc
Your commit message
Paarth-mindflix Jan 12, 2025
3adddcd
Your commit message
Paarth-mindflix Jan 12, 2025
88ad00c
Your commit message
Paarth-mindflix Jan 13, 2025
7c6a26a
Your commit message
Paarth-mindflix Jan 13, 2025
004ce12
Your commit message
Paarth-mindflix Jan 13, 2025
f5d6aaa
Your commit message
Paarth-mindflix Jan 13, 2025
d11193e
Your commit message
Paarth-mindflix Jan 13, 2025
27ec298
Your commit message
Paarth-mindflix Jan 13, 2025
b932039
Your commit message
Paarth-mindflix Jan 13, 2025
b8c6f1e
Fixec error message
Paarth-mindflix Jan 13, 2025
e8f583e
Added mediapipe
Paarth-mindflix Jan 13, 2025
806b83f
Fixec error message
Paarth-mindflix Jan 13, 2025
05ddb21
added model yolo
Paarth-mindflix Jan 15, 2025
daf52c1
added model yolo
Paarth-mindflix Jan 15, 2025
80d865a
added model yolo
Paarth-mindflix Jan 15, 2025
b7b330c
added model yolo
Paarth-mindflix Jan 15, 2025
8421dd0
added model yolo
Paarth-mindflix Jan 15, 2025
01e3313
added model yolo
Paarth-mindflix Jan 15, 2025
6f3db20
added model yolo
Paarth-mindflix Jan 15, 2025
657b530
added model yolo
Paarth-mindflix Jan 15, 2025
5d7bfe5
added model yolo
Paarth-mindflix Jan 15, 2025
e5dcf4e
added model yolo
Paarth-mindflix Jan 15, 2025
d5dda76
added model yolo
Paarth-mindflix Jan 15, 2025
7622bea
added model yolo
Paarth-mindflix Jan 15, 2025
6bfa8b2
added model yolo
Paarth-mindflix Jan 15, 2025
b43fdb2
added model yolo
Paarth-mindflix Jan 15, 2025
706538a
added model yolo
Paarth-mindflix Jan 15, 2025
7ec4601
added model yolo
Paarth-mindflix Jan 15, 2025
e6a39ae
added model yolo
Paarth-mindflix Jan 15, 2025
251cc88
added model yolo
Paarth-mindflix Jan 16, 2025
fa0ecaf
added model yolo
Paarth-mindflix Jan 16, 2025
ac413e0
added model yolo
Paarth-mindflix Jan 16, 2025
8e4c680
added model yolo
Paarth-mindflix Jan 16, 2025
2ac08ea
Uncomment visualize, do not remove pyavi
Paarth-mindflix Jan 18, 2025
ae4499e
Uncomment visualize, do not remove anything
Paarth-mindflix Jan 18, 2025
60e678f
Default scene detection
Paarth-mindflix Jan 20, 2025
688b54a
Default scene detection
Paarth-mindflix Jan 20, 2025
57f5d15
Default scene detection
Paarth-mindflix Jan 20, 2025
23c737e
Default scene detection
Paarth-mindflix Jan 20, 2025
8639a3a
Default scene detection
Paarth-mindflix Jan 20, 2025
1747d92
Default scene detection
Paarth-mindflix Jan 20, 2025
1f151e4
Default scene detection
Paarth-mindflix Jan 21, 2025
28e4f91
Default scene detection
Paarth-mindflix Jan 21, 2025
7ee9bab
Default scene detection
Paarth-mindflix Jan 21, 2025
0326c3f
Default scene detection
Paarth-mindflix Jan 21, 2025
175c680
Final changes made, bye
Paarth-mindflix Jan 21, 2025
bbfbd94
Final changes made, bye
Paarth-mindflix Jan 22, 2025
1d10a2a
Final changes made, bye
Paarth-mindflix Jan 22, 2025
fc31308
Uploading to s3
Paarth-mindflix Jan 22, 2025
d32502b
Added to S3 bucket
Paarth-mindflix Feb 4, 2025
6c28fa8
Added to S3 bucket
Paarth-mindflix Feb 4, 2025
5779d54
Added to S3 bucket
Paarth-mindflix Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions batch_process.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import os
import subprocess
import argparse

def main(args):
# Ensure the output directory exists
if not os.path.exists(args.videoFolderOutput):
os.makedirs(args.videoFolderOutput)

# List all videos in the input directory
video_files = [f for f in os.listdir(args.videoFolderInput) if f.endswith(('.mp4', '.avi', '.mov'))]
if not video_files:
print(f"No video files found in the directory: {args.videoFolderInput}")
return

# Process each video
for video_file in video_files:
video_name = os.path.splitext(video_file)[0]

output_video_path = args.videoFolderOutput

# Ensure output directory for the video exists
if not os.path.exists(output_video_path):
os.makedirs(output_video_path)

# Build the command to call demoTalkNet.py
command = [
"python", "demoTalkNet.py",
"--videoName", video_name,
"--videoFolderInput", args.videoFolderInput,
"--videoFolderOutput", args.videoFolderOutput,
"--channelName", args.channelName,
]

# Print and execute the command
print(f"Processing video: {video_file}")
print("Command:", " ".join(command))
subprocess.run(command)

print("Batch processing completed.")

if __name__ == "__main__":
# Parse arguments for the batch process
parser = argparse.ArgumentParser(description="Batch Process Videos with demoTalkNet")
parser.add_argument('--videoFolderInput', type=str, required=True, help='Path to the folder containing input videos.')
parser.add_argument('--videoFolderOutput', default="output_dir", type=str, help='Path to the folder for storing outputs and temporary files.')
parser.add_argument('--bucketName', type=str, help='Path to the folder for storing outputs and temporary files.')
parser.add_argument('--channelName', type=str, required=True, help='Path to the folder for storing outputs and temporary files.')
parser.add_argument('--pretrainModel', type=str,default="pretrain_TalkSet.model", help='Path to the pretrained TalkNet model.')
parser.add_argument('--fps', type=float, default=25, help='Desired FPS.')
parser.add_argument('--frame_size', type=int, default=512, help='Desired frame size.')
parser.add_argument('--angleThreshold', type=int, default=10, help='Yaw threshold.')
parser.add_argument('--contentDetectorThreshold', type=float, default=27.0, help='Content detector threshold.')
parser.add_argument('--thresholdDetectorThreshold', type=float, default=30.0, help='Threshold detector threshold.')
parser.add_argument('--nDataLoaderThread', type=int, default=10, help='Number of data loader threads.')
parser.add_argument('--facedetScale', type=float, default=0.25, help='Face detection scale factor.')
parser.add_argument('--minTrack', type=int, default=40, help='Minimum frames for each shot.')
parser.add_argument('--numFailedDet', type=int, default=5, help='Missed detections allowed before stopping tracking.')
parser.add_argument('--minFaceSize', type=int, default=100, help='Minimum face size in pixels.')
parser.add_argument('--cropScale', type=float, default=0.40, help='Scale bounding box.')
parser.add_argument('--start', type=int, default=0, help='Start time of the video.')
parser.add_argument('--duration', type=int, default=0, help='Duration of the video (0 for full video).')
parser.add_argument('--evalCol', action='store_true', help='Evaluate on Columbia dataset.')
parser.add_argument('--colSavePath', type=str, default="/data08/col", help='Path for inputs, temps, and outputs for Columbia evaluation.')

args = parser.parse_args()
main(args)
1,319 changes: 907 additions & 412 deletions demoTalkNet.py

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions fileTransfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import boto3
import os

# Define the bucket name and local folder path
bucket_name = "scenespart1"
local_folder_path = "/home/ubuntu/ZeeNews" # Folder to upload
s3_object_key_prefix = "croppedData/ZeeNews_output/" # S3 destination prefix

# Create an S3 client
s3_client = boto3.client("s3")

def upload_folder_to_s3(local_folder, bucket, s3_prefix):
try:
for root, dirs, files in os.walk(local_folder):
for file in files:
local_file_path = os.path.join(root, file)
# Create the relative path for S3 object key
relative_path = os.path.relpath(local_file_path, local_folder)
s3_object_key = os.path.join(s3_prefix, relative_path)

# Upload the file
s3_client.upload_file(local_file_path, bucket, s3_object_key)
print(f"Uploaded {local_file_path} to s3://{bucket}/{s3_object_key}")

except Exception as e:
print(f"Error uploading folder to S3: {e}")

# Call the function to upload the folder
upload_folder_to_s3(local_folder_path, bucket_name, s3_object_key_prefix)
29 changes: 29 additions & 0 deletions fileTransferFolder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import boto3
import os

# Define the bucket name and local folder path
bucket_name = "scenespart1"
local_folder_path = "/home/ubuntu/ZeeNews" # Folder to upload
s3_object_key_prefix = "croppedData/ZeeNews_output/" # S3 destination prefix

# Create an S3 client
s3_client = boto3.client("s3")

def upload_folder_to_s3(local_folder, bucket, s3_prefix):
try:
for root, dirs, files in os.walk(local_folder):
for file in files:
local_file_path = os.path.join(root, file)
# Create the relative path for S3 object key
relative_path = os.path.relpath(local_file_path, local_folder)
s3_object_key = os.path.join(s3_prefix, relative_path)

# Upload the file
s3_client.upload_file(local_file_path, bucket, s3_object_key)
print(f"Uploaded {local_file_path} to s3://{bucket}/{s3_object_key}")

except Exception as e:
print(f"Error uploading folder to S3: {e}")

# Call the function to upload the folder
upload_folder_to_s3(local_folder_path, bucket_name, s3_object_key_prefix)
2 changes: 1 addition & 1 deletion model/faceDetector/s3fd/box_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def nms_(dets, thresh):
inds = np.where(ovr <= thresh)[0]
order = order[inds + 1]

return np.array(keep).astype(np.int)
return np.array(keep).astype(int)


def decode(loc, priors, variances):
Expand Down
Binary file added model/faceDetector/yolov11n-face.pt
Binary file not shown.
3 changes: 2 additions & 1 deletion requirement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ python_speech_features
torchvision
ffmpeg
gdown
youtube-dl
youtube-dl
mediapipe==0.10.9
19 changes: 19 additions & 0 deletions s3_uploader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import boto3

def upload_file_to_s3(local_file, bucket, s3_key):
"""
Upload a single file to an S3 bucket.

:param local_file: Path to the local file.
:param bucket: Name of the S3 bucket.
:param s3_key: Path and name of the file in the S3 bucket.
"""
# Create an S3 client
s3_client = boto3.client("s3")

try:
# Upload the file
s3_client.upload_file(local_file, bucket, s3_key)
print(f"Uploaded {local_file} to s3://{bucket}/{s3_key}")
except Exception as e:
print(f"Error uploading file: {e}")