Anne Marthe Sophie Ngo Bibinbe commited on
Commit
4db4d20
·
1 Parent(s): 287f781

promptTrack installed

Browse files
Files changed (3) hide show
  1. app.py +30 -20
  2. install.sh +3 -0
  3. requirements.txt +7 -6
app.py CHANGED
@@ -155,33 +155,43 @@ if __name__ == "__main__":
155
  '''
156
 
157
 
 
 
 
 
158
  import gradio as gr
159
  import shutil
160
  import os
161
 
162
- def process_video(video_path, prompt):
163
- output_video = "output.mp4" # Placeholder for processed video
164
- output_file = "output.txt" # Placeholder for generated file
 
 
165
 
166
- # Copy the input video to simulate processing
167
- shutil.copy(video_path, output_video)
 
 
 
 
168
 
169
- # Create an output text file with the prompt content
170
- with open(output_file, "w") as f:
171
- f.write(f"User Prompt: {prompt}\n")
172
 
173
- return output_video, output_file
174
 
175
- # Define Gradio interface
176
- iface = gr.Interface(
177
- fn=process_video,
178
- inputs=[gr.File(label="Upload Video"), gr.Textbox(placeholder="Enter your prompt")],
179
- outputs=[gr.Video(), gr.File(label="Generated File")],
180
- title="Video Processing App",
181
- description="Upload a video and enter a prompt. The app will return the processed video and a generated file."
182
- )
183
 
184
 
185
- # Launch the app
186
- if __name__ == "__main__":
187
- iface.launch()
 
155
  '''
156
 
157
 
158
+ import gradio as gr
159
+ import shutil
160
+ import os
161
+ import subprocess
162
  import gradio as gr
163
  import shutil
164
  import os
165
 
166
+ # Run the .bat file before launching the app
167
+ subprocess.run(["install.sh"], shell=True)
168
+
169
+ import promptTrack
170
+ # def process_video(video_path, prompt):
171
 
172
+ # output_video = "output.mp4" # Placeholder for processed video
173
+ # output_file = "tracking.json" # Tracking result
174
+ # output_file_2 = "detection.json" # detection results
175
+
176
+ # # Copy the input video to simulate processing
177
+ # shutil.copy(video_path, output_video)
178
 
179
+ # # Create an output text file with the prompt content
180
+ # with open(output_file, "w") as f:
181
+ # f.write(f"User Prompt: {prompt}\n")
182
 
183
+ # return output_video, output_file
184
 
185
+ # # Define Gradio interface
186
+ # iface = gr.Interface(
187
+ # fn=process_video,
188
+ # inputs=[gr.File(label="Upload Video"), gr.Textbox(placeholder="Enter your prompt")],
189
+ # outputs=[gr.Video(), gr.File(label="Generated File")],
190
+ # title="Video Processing App",
191
+ # description="Upload a video and enter a prompt. The app will return the processed video and a generated file."
192
+ # )
193
 
194
 
195
+ # # Launch the app
196
+ # if __name__ == "__main__":
197
+ # iface.launch(share=True)
install.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ PromptTrack (version test)
2
+
3
+ pip install --no-deps bytetracker
requirements.txt CHANGED
@@ -1,6 +1,7 @@
1
- accelerate
2
- diffusers
3
- invisible_watermark
4
- torch
5
- transformers
6
- xformers
 
 
1
+
2
+ # accelerate
3
+ # diffusers
4
+ # invisible_watermark
5
+ # torch
6
+ # transformers
7
+ # xformers